more tests

This commit is contained in:
Devyn Cairns 2024-07-04 00:48:29 -07:00
parent 6398f0e31e
commit c3712f4337
No known key found for this signature in database

View File

@ -114,6 +114,16 @@ fn literal_float() {
test_eval("1.5", Eq("1.5"))
}
#[test]
fn literal_filesize() {
test_eval("30MiB", Eq("30.0 MiB"))
}
#[test]
fn literal_duration() {
test_eval("30ms", Eq("30ms"))
}
#[test]
fn literal_binary() {
test_eval("0x[1f 2f f0]", Matches("Length.*1f.*2f.*f0"))
@ -443,3 +453,14 @@ fn row_condition() {
Eq("[[a, b]; [1, 2]]"),
)
}
#[test]
fn custom_command() {
test_eval(
r#"
def cmd [a: int, b: string = 'fail', ...c: string, --x: int] { $"($a)($b)($c)($x)" }
cmd 42 pass foo --x 30
"#,
Eq("42pass[foo]30"),
)
}