mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-13 22:12:12 +00:00
test(stencilcraft-format): cover scalar JSON roots
This commit is contained in:
1 parent
7c3a099ad8
commit
eb379cf3d2
1 file changed
+7
@@ -362,6 +362,13 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn scalar_roots_are_not_documents() {
|
||||
for text in ["false", "-1", "1", "1.5", "\"scalar\"", "null"] {
|
||||
assert!(matches!(File::read(text), Err(Error::NotStencilCraft)));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn refuses_versions_other_than_the_current_version() {
|
||||
assert!(matches!(File::read(r#"{"stencilcraft":{"name":"stencilcraft","version":2}}"#), Err(Error::Version { found: 2, supported: 1 })));
|
||||
|
||||
Reference in new issue
Block a user