diff options
| author | Laurenz Stampfl <47084093+LaurenzV@users.noreply.github.com> | 2023-05-23 10:41:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-23 10:41:20 +0200 |
| commit | 752817ae74607ca23ec0aad51824ddca66faa7a8 (patch) | |
| tree | d9f51f3d029c1ca8754be9ae9ccc9dc91ae6b000 /tests/src/tests.rs | |
| parent | f4fd6855e7fb833a2125d2e81aa3b9f548b18170 (diff) | |
Add support for date & time handling (#435)
Diffstat (limited to 'tests/src/tests.rs')
| -rw-r--r-- | tests/src/tests.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/src/tests.rs b/tests/src/tests.rs index f295869f..c2d0cc68 100644 --- a/tests/src/tests.rs +++ b/tests/src/tests.rs @@ -22,7 +22,7 @@ use walkdir::WalkDir; use typst::diag::{bail, FileError, FileResult}; use typst::doc::{Document, Frame, FrameItem, Meta}; -use typst::eval::{func, Library, Value}; +use typst::eval::{func, Datetime, Library, Value}; use typst::font::{Font, FontBook}; use typst::geom::{Abs, Color, RgbaColor, Sides, Smart}; use typst::syntax::{Source, SourceId, Span, SyntaxNode}; @@ -296,6 +296,10 @@ impl World for TestWorld { .get_or_init(|| read(path).map(Buffer::from)) .clone() } + + fn today(&self, _: Option<i64>) -> Option<Datetime> { + Some(Datetime::from_ymd(1970, 1, 1).unwrap()) + } } impl TestWorld { |
