summaryrefslogtreecommitdiff
path: root/serde_dhall/tests
diff options
context:
space:
mode:
authorNadrieril2020-12-07 11:56:00 +0000
committerNadrieril2020-12-07 19:34:38 +0000
commit697e93e0f56e3c063ce253983f703be88d468b47 (patch)
treec7217ddd01c149ef15f630cfae0b4582fe014607 /serde_dhall/tests
parent35ed301e8de5a2b1102e370e638564d3c3d204a8 (diff)
Don't store internal structures of `dhall` in `serde_dhall`
Diffstat (limited to 'serde_dhall/tests')
-rw-r--r--serde_dhall/tests/simple_value.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/serde_dhall/tests/simple_value.rs b/serde_dhall/tests/simple_value.rs
index 3bd9d64..3d40da1 100644
--- a/serde_dhall/tests/simple_value.rs
+++ b/serde_dhall/tests/simple_value.rs
@@ -1,7 +1,7 @@
mod simple_value {
use serde::{Deserialize, Serialize};
use serde_dhall::{
- from_str, serialize, FromDhall, NumKind, SimpleValue, ToDhall,
+ from_str, serialize, FromDhall, NumKind, SimpleValue, ToDhall, Value,
};
fn assert_de<T>(s: &str, x: T)
@@ -54,5 +54,17 @@ mod simple_value {
foo: bool_true.clone(),
},
);
+
+ // Neither a simple value or a simple type.
+ let not_simple = "Type → Type";
+ assert_eq!(
+ from_str(not_simple)
+ .parse::<Value>()
+ .map_err(|e| e.to_string()),
+ Err(format!(
+ "this is neither a simple type nor a simple value: {}",
+ not_simple
+ ))
+ );
}
}