forked from the-distro/ofborg
fix nix tests with nix 2.0
This commit is contained in:
parent
ab2b5c5db4
commit
5b5498955a
|
@ -304,6 +304,14 @@ mod tests {
|
||||||
return cwd;
|
return cwd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn strip_ansi(string: &str) -> String {
|
||||||
|
string
|
||||||
|
.replace("‘", "'")
|
||||||
|
.replace("’", "'")
|
||||||
|
.replace("\u{1b}[31;1m", "") // red
|
||||||
|
.replace("\u{1b}[0m", "") // reset
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
enum Expect {
|
enum Expect {
|
||||||
Pass,
|
Pass,
|
||||||
|
@ -325,7 +333,7 @@ mod tests {
|
||||||
|
|
||||||
let buildlog = lines
|
let buildlog = lines
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|line| line.replace("\u{1b}[0m", "")) // ANSI reset
|
.map(|line| strip_ansi(&line))
|
||||||
.map(|line| format!(" | {}", line))
|
.map(|line| format!(" | {}", line))
|
||||||
.collect::<Vec<String>>()
|
.collect::<Vec<String>>()
|
||||||
.join("\n");
|
.join("\n");
|
||||||
|
@ -588,10 +596,10 @@ mod tests {
|
||||||
assert_eq!(ret.0, vec!["passes-instantiation"]);
|
assert_eq!(ret.0, vec!["passes-instantiation"]);
|
||||||
|
|
||||||
assert_eq!(ret.1[0].0, "fails-instantiation");
|
assert_eq!(ret.1[0].0, "fails-instantiation");
|
||||||
assert_eq!(ret.1[0].1[0], "trace: You just can\'t frooble the frozz on this particular system.");
|
assert_eq!(ret.1[0].1[0], "trace: You just can't frooble the frozz on this particular system.");
|
||||||
|
|
||||||
assert_eq!(ret.1[1].0, "missing-attr");
|
assert_eq!(ret.1[1].0, "missing-attr");
|
||||||
assert_eq!(ret.1[1].1[0], "error: attribute ‘missing-attr’ in selection path ‘missing-attr’ not found");
|
assert_eq!(strip_ansi(&ret.1[1].1[0]), "error: attribute 'missing-attr' in selection path 'missing-attr' not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Reference in a new issue