summaryrefslogtreecommitdiff
path: root/tests/src
diff options
context:
space:
mode:
authorMALO <57839069+MDLC01@users.noreply.github.com>2023-10-04 12:08:56 +0200
committerGitHub <noreply@github.com>2023-10-04 12:08:56 +0200
commit333e4037fcfc806137867e592c124811059e5c3d (patch)
tree4e254fb6fa94d4c83a0ef90450bf17454e9aad8f /tests/src
parent57bc614cf472c080800afff6df74b354375be4b4 (diff)
Add `Repr` trait (#2269)
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/tests.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/src/tests.rs b/tests/src/tests.rs
index d7536907..d690cdb3 100644
--- a/tests/src/tests.rs
+++ b/tests/src/tests.rs
@@ -22,7 +22,9 @@ use walkdir::WalkDir;
use typst::diag::{bail, FileError, FileResult, Severity, StrResult};
use typst::doc::{Document, Frame, FrameItem, Meta};
-use typst::eval::{eco_format, func, Bytes, Datetime, Library, NoneValue, Tracer, Value};
+use typst::eval::{
+ eco_format, func, Bytes, Datetime, Library, NoneValue, Repr, Tracer, Value,
+};
use typst::font::{Font, FontBook};
use typst::geom::{Abs, Color, Smart};
use typst::syntax::{FileId, PackageVersion, Source, SyntaxNode, VirtualPath};
@@ -154,7 +156,7 @@ fn library() -> Library {
#[func]
fn test(lhs: Value, rhs: Value) -> StrResult<NoneValue> {
if lhs != rhs {
- bail!("Assertion failed: {lhs:?} != {rhs:?}");
+ bail!("Assertion failed: {} != {}", lhs.repr(), rhs.repr());
}
Ok(NoneValue)
}
@@ -162,7 +164,7 @@ fn library() -> Library {
#[func]
fn test_repr(lhs: Value, rhs: Value) -> StrResult<NoneValue> {
if lhs.repr() != rhs.repr() {
- bail!("Assertion failed: {lhs:?} != {rhs:?}");
+ bail!("Assertion failed: {} != {}", lhs.repr(), rhs.repr());
}
Ok(NoneValue)
}