use a s!(..) shorthand in CLI tests
This commit is contained in:
@@ -197,27 +197,27 @@ mod test {
|
||||
fn test_id_list_uuids() {
|
||||
assert_eq!(
|
||||
id_list("12341234").unwrap().1,
|
||||
vec![TaskId::PartialUuid("12341234".to_owned())]
|
||||
vec![TaskId::PartialUuid(s!("12341234"))]
|
||||
);
|
||||
assert_eq!(
|
||||
id_list("1234abcd").unwrap().1,
|
||||
vec![TaskId::PartialUuid("1234abcd".to_owned())]
|
||||
vec![TaskId::PartialUuid(s!("1234abcd"))]
|
||||
);
|
||||
assert_eq!(
|
||||
id_list("abcd1234").unwrap().1,
|
||||
vec![TaskId::PartialUuid("abcd1234".to_owned())]
|
||||
vec![TaskId::PartialUuid(s!("abcd1234"))]
|
||||
);
|
||||
assert_eq!(
|
||||
id_list("abcd1234-1234").unwrap().1,
|
||||
vec![TaskId::PartialUuid("abcd1234-1234".to_owned())]
|
||||
vec![TaskId::PartialUuid(s!("abcd1234-1234"))]
|
||||
);
|
||||
assert_eq!(
|
||||
id_list("abcd1234-1234-2345").unwrap().1,
|
||||
vec![TaskId::PartialUuid("abcd1234-1234-2345".to_owned())]
|
||||
vec![TaskId::PartialUuid(s!("abcd1234-1234-2345"))]
|
||||
);
|
||||
assert_eq!(
|
||||
id_list("abcd1234-1234-2345-3456").unwrap().1,
|
||||
vec![TaskId::PartialUuid("abcd1234-1234-2345-3456".to_owned())]
|
||||
vec![TaskId::PartialUuid(s!("abcd1234-1234-2345-3456"))]
|
||||
);
|
||||
assert_eq!(
|
||||
id_list("abcd1234-1234-2345-3456-0123456789ab").unwrap().1,
|
||||
@@ -241,10 +241,10 @@ mod test {
|
||||
#[test]
|
||||
fn test_id_list_uuids_mixed() {
|
||||
assert_eq!(id_list("abcd1234,abcd1234-1234,abcd1234-1234-2345,abcd1234-1234-2345-3456,abcd1234-1234-2345-3456-0123456789ab").unwrap().1,
|
||||
vec![TaskId::PartialUuid("abcd1234".to_owned()),
|
||||
TaskId::PartialUuid("abcd1234-1234".to_owned()),
|
||||
TaskId::PartialUuid("abcd1234-1234-2345".to_owned()),
|
||||
TaskId::PartialUuid("abcd1234-1234-2345-3456".to_owned()),
|
||||
vec![TaskId::PartialUuid(s!("abcd1234")),
|
||||
TaskId::PartialUuid(s!("abcd1234-1234")),
|
||||
TaskId::PartialUuid(s!("abcd1234-1234-2345")),
|
||||
TaskId::PartialUuid(s!("abcd1234-1234-2345-3456")),
|
||||
TaskId::Uuid(Uuid::parse_str("abcd1234-1234-2345-3456-0123456789ab").unwrap()),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ mod test {
|
||||
Command::from_argv(argv!["task", "version"]).unwrap(),
|
||||
Command {
|
||||
subcommand: Subcommand::Version,
|
||||
command_name: "task".to_owned(),
|
||||
command_name: s!("task"),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ mod test {
|
||||
Filter {
|
||||
universe: Universe::IdList(vec![
|
||||
TaskId::WorkingSetId(1),
|
||||
TaskId::PartialUuid("abcd1234".to_owned()),
|
||||
TaskId::PartialUuid(s!("abcd1234")),
|
||||
]),
|
||||
..Default::default()
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ mod test {
|
||||
assert_eq!(
|
||||
modification,
|
||||
Modification {
|
||||
description: DescriptionMod::Set("newdesc".to_owned()),
|
||||
description: DescriptionMod::Set(s!("newdesc")),
|
||||
..Default::default()
|
||||
}
|
||||
);
|
||||
@@ -168,7 +168,7 @@ mod test {
|
||||
assert_eq!(
|
||||
modification,
|
||||
Modification {
|
||||
add_tags: set!["abc".to_owned(), "def".to_owned()],
|
||||
add_tags: set![s!("abc"), s!("def")],
|
||||
..Default::default()
|
||||
}
|
||||
);
|
||||
@@ -181,7 +181,7 @@ mod test {
|
||||
assert_eq!(
|
||||
modification,
|
||||
Modification {
|
||||
description: DescriptionMod::Set("new desc fun".to_owned()),
|
||||
description: DescriptionMod::Set(s!("new desc fun")),
|
||||
..Default::default()
|
||||
}
|
||||
);
|
||||
@@ -195,9 +195,9 @@ mod test {
|
||||
assert_eq!(
|
||||
modification,
|
||||
Modification {
|
||||
description: DescriptionMod::Set("new desc fun".to_owned()),
|
||||
add_tags: set!["next".to_owned()],
|
||||
remove_tags: set!["daytime".to_owned()],
|
||||
description: DescriptionMod::Set(s!("new desc fun")),
|
||||
add_tags: set![s!("next")],
|
||||
remove_tags: set![s!("daytime")],
|
||||
..Default::default()
|
||||
}
|
||||
);
|
||||
|
||||
@@ -409,7 +409,7 @@ mod test {
|
||||
fn test_add_description() {
|
||||
let subcommand = Subcommand::Add {
|
||||
modification: Modification {
|
||||
description: DescriptionMod::Set("foo".to_owned()),
|
||||
description: DescriptionMod::Set(s!("foo")),
|
||||
..Default::default()
|
||||
},
|
||||
};
|
||||
@@ -423,7 +423,7 @@ mod test {
|
||||
fn test_add_description_multi() {
|
||||
let subcommand = Subcommand::Add {
|
||||
modification: Modification {
|
||||
description: DescriptionMod::Set("foo bar".to_owned()),
|
||||
description: DescriptionMod::Set(s!("foo bar")),
|
||||
..Default::default()
|
||||
},
|
||||
};
|
||||
@@ -441,7 +441,7 @@ mod test {
|
||||
..Default::default()
|
||||
},
|
||||
modification: Modification {
|
||||
description: DescriptionMod::Set("foo bar".to_owned()),
|
||||
description: DescriptionMod::Set(s!("foo bar")),
|
||||
..Default::default()
|
||||
},
|
||||
};
|
||||
@@ -459,7 +459,7 @@ mod test {
|
||||
..Default::default()
|
||||
},
|
||||
modification: Modification {
|
||||
description: DescriptionMod::Append("foo bar".to_owned()),
|
||||
description: DescriptionMod::Append(s!("foo bar")),
|
||||
..Default::default()
|
||||
},
|
||||
};
|
||||
@@ -477,7 +477,7 @@ mod test {
|
||||
..Default::default()
|
||||
},
|
||||
modification: Modification {
|
||||
description: DescriptionMod::Prepend("foo bar".to_owned()),
|
||||
description: DescriptionMod::Prepend(s!("foo bar")),
|
||||
..Default::default()
|
||||
},
|
||||
};
|
||||
@@ -513,7 +513,7 @@ mod test {
|
||||
..Default::default()
|
||||
},
|
||||
modification: Modification {
|
||||
description: DescriptionMod::Set("now-finished".to_owned()),
|
||||
description: DescriptionMod::Set(s!("now-finished")),
|
||||
status: Some(Status::Completed),
|
||||
..Default::default()
|
||||
},
|
||||
@@ -551,7 +551,7 @@ mod test {
|
||||
},
|
||||
modification: Modification {
|
||||
active: Some(true),
|
||||
description: DescriptionMod::Set("mod".to_owned()),
|
||||
description: DescriptionMod::Set(s!("mod")),
|
||||
..Default::default()
|
||||
},
|
||||
};
|
||||
@@ -587,7 +587,7 @@ mod test {
|
||||
..Default::default()
|
||||
},
|
||||
modification: Modification {
|
||||
description: DescriptionMod::Set("mod".to_owned()),
|
||||
description: DescriptionMod::Set(s!("mod")),
|
||||
active: Some(false),
|
||||
..Default::default()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user