Update tests to use templates instead of literal strings for string parameters.
This commit is contained in:
parent
d99aa44d8e
commit
2a89fd826e
@ -1204,7 +1204,9 @@ mod tests {
|
|||||||
},
|
},
|
||||||
KVPair {
|
KVPair {
|
||||||
key: "animal",
|
key: "animal",
|
||||||
value: RValue::RVLiteral(OwnedLiteral::LString("cat".to_owned()))
|
value: RValue::RVTemplate(vec![PartialNameElement::PNSpan {
|
||||||
|
contents: "cat".to_owned()
|
||||||
|
}])
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -1230,7 +1232,9 @@ mod tests {
|
|||||||
},
|
},
|
||||||
KVPair {
|
KVPair {
|
||||||
key: "animal",
|
key: "animal",
|
||||||
value: RValue::RVLiteral(OwnedLiteral::LString("cat".to_owned()))
|
value: RValue::RVTemplate(vec![PartialNameElement::PNSpan {
|
||||||
|
contents: "cat".to_owned()
|
||||||
|
}])
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -1265,7 +1269,9 @@ mod tests {
|
|||||||
},
|
},
|
||||||
KVPair {
|
KVPair {
|
||||||
key: "animal",
|
key: "animal",
|
||||||
value: RValue::RVLiteral(OwnedLiteral::LString("cat".to_owned()))
|
value: RValue::RVTemplate(vec![PartialNameElement::PNSpan {
|
||||||
|
contents: "cat".to_owned()
|
||||||
|
}])
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -1293,7 +1299,9 @@ mod tests {
|
|||||||
},
|
},
|
||||||
KVPair {
|
KVPair {
|
||||||
key: "animal",
|
key: "animal",
|
||||||
value: RValue::RVLiteral(OwnedLiteral::LString("cat".to_owned()))
|
value: RValue::RVTemplate(vec![PartialNameElement::PNSpan {
|
||||||
|
contents: "cat".to_owned()
|
||||||
|
}])
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -1323,7 +1331,9 @@ mod tests {
|
|||||||
},
|
},
|
||||||
KVPair {
|
KVPair {
|
||||||
key: "animal",
|
key: "animal",
|
||||||
value: RValue::RVLiteral(OwnedLiteral::LString("cat".to_owned()))
|
value: RValue::RVTemplate(vec![PartialNameElement::PNSpan {
|
||||||
|
contents: "cat".to_owned()
|
||||||
|
}])
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -1334,7 +1344,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_literals() {
|
fn test_literals() {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
dust_tag(r#"{>foo a="foo" b=179/}"#),
|
dust_tag(r#"{>foo a="foo" b=179 c=17.1 d=-12 e=-17.4/}"#),
|
||||||
Ok((
|
Ok((
|
||||||
"",
|
"",
|
||||||
DustTag::DTPartial(Partial {
|
DustTag::DTPartial(Partial {
|
||||||
@ -1345,11 +1355,25 @@ mod tests {
|
|||||||
params: vec![
|
params: vec![
|
||||||
KVPair {
|
KVPair {
|
||||||
key: "a",
|
key: "a",
|
||||||
value: RValue::RVLiteral(OwnedLiteral::LString("foo".to_owned()))
|
value: RValue::RVTemplate(vec![PartialNameElement::PNSpan {
|
||||||
|
contents: "foo".to_owned()
|
||||||
|
}])
|
||||||
},
|
},
|
||||||
KVPair {
|
KVPair {
|
||||||
key: "b",
|
key: "b",
|
||||||
value: RValue::RVLiteral(OwnedLiteral::LPositiveInteger(179))
|
value: RValue::RVLiteral(OwnedLiteral::LPositiveInteger(179))
|
||||||
|
},
|
||||||
|
KVPair {
|
||||||
|
key: "c",
|
||||||
|
value: RValue::RVLiteral(OwnedLiteral::LFloat(17.1))
|
||||||
|
},
|
||||||
|
KVPair {
|
||||||
|
key: "d",
|
||||||
|
value: RValue::RVLiteral(OwnedLiteral::LNegativeInteger(-12))
|
||||||
|
},
|
||||||
|
KVPair {
|
||||||
|
key: "e",
|
||||||
|
value: RValue::RVLiteral(OwnedLiteral::LFloat(-17.4))
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -1373,7 +1397,9 @@ mod tests {
|
|||||||
},
|
},
|
||||||
KVPair {
|
KVPair {
|
||||||
key: "value",
|
key: "value",
|
||||||
value: RValue::RVLiteral(OwnedLiteral::LString("cat".to_owned()))
|
value: RValue::RVTemplate(vec![PartialNameElement::PNSpan {
|
||||||
|
contents: "cat".to_owned()
|
||||||
|
}])
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
contents: Some(Body {
|
contents: Some(Body {
|
||||||
@ -1410,7 +1436,9 @@ mod tests {
|
|||||||
},
|
},
|
||||||
KVPair {
|
KVPair {
|
||||||
key: "value",
|
key: "value",
|
||||||
value: RValue::RVLiteral(OwnedLiteral::LString("cat".to_owned()))
|
value: RValue::RVTemplate(vec![PartialNameElement::PNSpan {
|
||||||
|
contents: "cat".to_owned()
|
||||||
|
}])
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
contents: None,
|
contents: None,
|
||||||
@ -1438,7 +1466,9 @@ mod tests {
|
|||||||
},
|
},
|
||||||
KVPair {
|
KVPair {
|
||||||
key: "value",
|
key: "value",
|
||||||
value: RValue::RVLiteral(OwnedLiteral::LString("cat".to_owned()))
|
value: RValue::RVTemplate(vec![PartialNameElement::PNSpan {
|
||||||
|
contents: "cat".to_owned()
|
||||||
|
}])
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
contents: Some(Body {
|
contents: Some(Body {
|
||||||
@ -1477,7 +1507,9 @@ mod tests {
|
|||||||
},
|
},
|
||||||
KVPair {
|
KVPair {
|
||||||
key: "value",
|
key: "value",
|
||||||
value: RValue::RVLiteral(OwnedLiteral::LString("cat".to_owned()))
|
value: RValue::RVTemplate(vec![PartialNameElement::PNSpan {
|
||||||
|
contents: "cat".to_owned()
|
||||||
|
}])
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
contents: None,
|
contents: None,
|
||||||
@ -1593,33 +1625,43 @@ mod tests {
|
|||||||
params: vec![
|
params: vec![
|
||||||
KVPair {
|
KVPair {
|
||||||
key: "v1",
|
key: "v1",
|
||||||
value: RValue::RVLiteral(
|
value: RValue::RVTemplate(vec![
|
||||||
OwnedLiteral::LString("b".to_owned())
|
PartialNameElement::PNSpan {
|
||||||
)
|
contents: "b".to_owned()
|
||||||
|
}
|
||||||
|
])
|
||||||
},
|
},
|
||||||
KVPair {
|
KVPair {
|
||||||
key: "v2",
|
key: "v2",
|
||||||
value: RValue::RVLiteral(
|
value: RValue::RVTemplate(vec![
|
||||||
OwnedLiteral::LString("b".to_owned())
|
PartialNameElement::PNSpan {
|
||||||
)
|
contents: "b".to_owned()
|
||||||
|
}
|
||||||
|
])
|
||||||
},
|
},
|
||||||
KVPair {
|
KVPair {
|
||||||
key: "v3",
|
key: "v3",
|
||||||
value: RValue::RVLiteral(
|
value: RValue::RVTemplate(vec![
|
||||||
OwnedLiteral::LString("b".to_owned())
|
PartialNameElement::PNSpan {
|
||||||
)
|
contents: "b".to_owned()
|
||||||
|
}
|
||||||
|
])
|
||||||
},
|
},
|
||||||
KVPair {
|
KVPair {
|
||||||
key: "v4",
|
key: "v4",
|
||||||
value: RValue::RVLiteral(
|
value: RValue::RVTemplate(vec![
|
||||||
OwnedLiteral::LString("b".to_owned())
|
PartialNameElement::PNSpan {
|
||||||
)
|
contents: "b".to_owned()
|
||||||
|
}
|
||||||
|
])
|
||||||
},
|
},
|
||||||
KVPair {
|
KVPair {
|
||||||
key: "v5",
|
key: "v5",
|
||||||
value: RValue::RVLiteral(
|
value: RValue::RVTemplate(vec![
|
||||||
OwnedLiteral::LString("b".to_owned())
|
PartialNameElement::PNSpan {
|
||||||
)
|
contents: "b".to_owned()
|
||||||
|
}
|
||||||
|
])
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user