mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
wrap tests with #[cfg(test)]
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
This commit is contained in:
parent
d18000fee8
commit
be6105a202
6 changed files with 455 additions and 431 deletions
|
@ -130,20 +130,25 @@ impl From<PrefValue> for [f64; 4] {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_pref_value_from_str() {
|
||||
let value = PrefValue::from_booleanish_str("21");
|
||||
assert_eq!(value, PrefValue::Int(21));
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::PrefValue;
|
||||
|
||||
let value = PrefValue::from_booleanish_str("12.5");
|
||||
assert_eq!(value, PrefValue::Float(12.5));
|
||||
#[test]
|
||||
fn test_pref_value_from_str() {
|
||||
let value = PrefValue::from_booleanish_str("21");
|
||||
assert_eq!(value, PrefValue::Int(21));
|
||||
|
||||
let value = PrefValue::from_booleanish_str("a string");
|
||||
assert_eq!(value, PrefValue::Str("a string".into()));
|
||||
let value = PrefValue::from_booleanish_str("12.5");
|
||||
assert_eq!(value, PrefValue::Float(12.5));
|
||||
|
||||
let value = PrefValue::from_booleanish_str("false");
|
||||
assert_eq!(value, PrefValue::Bool(false));
|
||||
let value = PrefValue::from_booleanish_str("a string");
|
||||
assert_eq!(value, PrefValue::Str("a string".into()));
|
||||
|
||||
let value = PrefValue::from_booleanish_str("true");
|
||||
assert_eq!(value, PrefValue::Bool(true));
|
||||
let value = PrefValue::from_booleanish_str("false");
|
||||
assert_eq!(value, PrefValue::Bool(false));
|
||||
|
||||
let value = PrefValue::from_booleanish_str("true");
|
||||
assert_eq!(value, PrefValue::Bool(true));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue