summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-05-09 10:17:59 +0200
committerMatthias Beyer <mail@beyermatthias.de>2020-05-09 10:41:14 +0200
commit176b56fdbaffcf8e665e3a8a9b43c8d988de237d (patch)
tree82e624c29c6583ca60bb31f377053900d338630a
parent7618ca3e231921a354ce47b0b79adfee24f48b4f (diff)
Give type hint in tests
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--src/resolver.rs54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/resolver.rs b/src/resolver.rs
index d87fe35..533bfb6 100644
--- a/src/resolver.rs
+++ b/src/resolver.rs
@@ -75,7 +75,7 @@ mod test {
#[test]
fn test_resolve_empty_toml_simple_query() {
- let toml = toml_from_str("").unwrap();
+ let toml : toml::Value = toml_from_str("").unwrap();
let result = do_resolve!(toml => "example");
assert!(result.is_err());
@@ -86,7 +86,7 @@ mod test {
#[test]
fn test_resolve_present_bool() {
- let toml = toml_from_str("example = true").unwrap();
+ let toml: toml::Value = toml_from_str("example = true").unwrap();
let result = do_resolve!(toml => "example");
assert!(result.is_ok());
@@ -100,7 +100,7 @@ mod test {
#[test]
fn test_resolve_present_integer() {
- let toml = toml_from_str("example = 1").unwrap();
+ let toml: toml::Value = toml_from_str("example = 1").unwrap();
let result = do_resolve!(toml => "example");
assert!(result.is_ok());
@@ -114,7 +114,7 @@ mod test {
#[test]
fn test_resolve_present_float() {
- let toml = toml_from_str("example = 1.0").unwrap();
+ let toml: toml::Value = toml_from_str("example = 1.0").unwrap();
let result = do_resolve!(toml => "example");
assert!(result.is_ok());
@@ -129,7 +129,7 @@ mod test {
#[test]
fn test_resolve_present_string() {
- let toml = toml_from_str("example = 'string'").unwrap();
+ let toml: toml::Value = toml_from_str("example = 'string'").unwrap();
let result = do_resolve!(toml => "example");
assert!(result.is_ok());
@@ -147,7 +147,7 @@ mod test {
#[test]
fn test_resolve_present_array_bools() {
- let toml = toml_from_str("example = [ true, false ]").unwrap();
+ let toml: toml::Value = toml_from_str("example = [ true, false ]").unwrap();
let result = do_resolve!(toml => "example");
assert!(result.is_ok());
@@ -168,7 +168,7 @@ mod test {
#[test]
fn test_resolve_present_array_integers() {
- let toml = toml_from_str("example = [ 1, 1337 ]").unwrap();
+ let toml: toml::Value = toml_from_str("example = [ 1, 1337 ]").unwrap();
let result = do_resolve!(toml => "example");
assert!(result.is_ok());
@@ -189,7 +189,7 @@ mod test {
#[test]
fn test_resolve_present_array_floats() {
- let toml = toml_from_str("example = [ 1.0, 133.25 ]").unwrap();
+ let toml: toml::Value = toml_from_str("example = [ 1.0, 133.25 ]").unwrap();
let result = do_resolve!(toml => "example");
assert!(result.is_ok());
@@ -212,7 +212,7 @@ mod test {
#[test]
fn test_resolve_array_index_query_1() {
- let toml = toml_from_str("example = [ 1 ]").unwrap();
+ let toml: toml::Value = toml_from_str("example = [ 1 ]").unwrap();
let result = do_resolve!(toml => "example.[0]");
assert!(result.is_ok());
@@ -226,7 +226,7 @@ mod test {
#[test]
fn test_resolve_array_index_query_2() {
- let toml = toml_from_str("example = [ 1, 2, 3, 4, 5 ]").unwrap();
+ let toml: toml::Value = toml_from_str("example = [ 1, 2, 3, 4, 5 ]").unwrap();
let result = do_resolve!(toml => "example.[4]");
assert!(result.is_ok());
@@ -240,7 +240,7 @@ mod test {
#[test]
fn test_resolve_table_element_query() {
- let toml = toml_from_str(
+ let toml: toml::Value = toml_from_str(
r#"
[table]
value = 42
@@ -260,7 +260,7 @@ mod test {
#[test]
fn test_resolve_table_with_many_elements_element_query() {
- let toml = toml_from_str(
+ let toml: toml::Value = toml_from_str(
r#"
[table]
value1 = 42
@@ -284,7 +284,7 @@ mod test {
#[test]
fn test_resolve_table_array_query() {
- let toml = toml_from_str(
+ let toml: toml::Value = toml_from_str(
r#"
[table]
value1 = [ 42.0, 50.0 ]
@@ -313,7 +313,7 @@ mod test {
#[test]
fn test_resolve_table_array_element_query() {
- let toml = toml_from_str(
+ let toml: toml::Value = toml_from_str(
r#"
[table]
value1 = [ 42 ]
@@ -333,7 +333,7 @@ mod test {
#[test]
fn test_resolve_multi_table_query() {
- let toml = toml_from_str(
+ let toml: toml::Value = toml_from_str(
r#"
[table0]
value = [ 1 ]
@@ -379,7 +379,7 @@ mod test {
#[test]
fn test_resolve_array_table_query_1() {
- let toml = toml_from_str(FRUIT_TABLE).unwrap();
+ let toml: toml::Value = toml_from_str(FRUIT_TABLE).unwrap();
let result = do_resolve!(toml => "fruit.blah.[0].name");
assert!(result.is_ok());
@@ -397,7 +397,7 @@ mod test {
#[test]
fn test_resolve_array_table_query_2() {
- let toml = toml_from_str(FRUIT_TABLE).unwrap();
+ let toml: toml::Value = toml_from_str(FRUIT_TABLE).unwrap();
let result = do_resolve!(toml => "fruit.blah.[0].physical");
assert!(result.is_ok());
@@ -424,7 +424,7 @@ mod test {
#[test]
fn test_resolve_query_on_result() {
- let toml = toml_from_str(FRUIT_TABLE).unwrap();
+ let toml: toml::Value = toml_from_str(FRUIT_TABLE).unwrap();
let result = do_resolve!(toml => "fruit.blah.[1].physical");
assert!(result.is_ok());
@@ -451,7 +451,7 @@ mod test {
#[test]
fn test_resolve_query_empty_table() {
- let toml = toml_from_str(
+ let toml: toml::Value = toml_from_str(
r#"
[example]
"#,
@@ -474,7 +474,7 @@ mod test {
#[test]
fn test_resolve_query_member_of_empty_table() {
- let toml = toml_from_str(
+ let toml: toml::Value = toml_from_str(
r#"
[example]
"#,
@@ -490,7 +490,7 @@ mod test {
#[test]
fn test_resolve_query_index_in_table() {
- let toml = toml_from_str(
+ let toml: toml::Value = toml_from_str(
r#"
[example]
"#,
@@ -506,7 +506,7 @@ mod test {
#[test]
fn test_resolve_query_identifier_in_array() {
- let toml = toml_from_str(
+ let toml: toml::Value = toml_from_str(
r#"
[example]
foo = [ 1, 2, 3 ]
@@ -523,7 +523,7 @@ mod test {
#[test]
fn test_resolve_query_value_as_table() {
- let toml = toml_from_str(
+ let toml: toml::Value = toml_from_str(
r#"
[example]
foo = 1
@@ -540,7 +540,7 @@ mod test {
#[test]
fn test_resolve_query_value_as_array() {
- let toml = toml_from_str(
+ let toml: toml::Value = toml_from_str(
r#"
[example]
foo = 1
@@ -557,7 +557,7 @@ mod test {
#[test]
fn test_indexing_out_of_bounds() {
- let toml = toml_from_str(
+ let toml: toml::Value = toml_from_str(
r#"
[example]
foo = [ 1, 2, 3 ]
@@ -574,7 +574,7 @@ mod test {
#[test]
fn test_indexing_out_of_bounds_edgecase_1() {
- let toml = toml_from_str(
+ let toml: toml::Value = toml_from_str(
r#"
[example]
foo = []
@@ -591,7 +591,7 @@ mod test {
#[test]
fn test_indexing_out_of_bounds_edgecase_2() {
- let toml = toml_from_str(
+ let toml: toml::Value = toml_from_str(
r#"
[example]
foo = [ 1 ]