more test fixes (#4499)

* more test fixes

* update multi-os err messages
This commit is contained in:
Darren Schroeder
2022-02-16 12:24:45 -06:00
committed by GitHub
parent 5b6156687e
commit b64ac9eb7b
6 changed files with 40 additions and 34 deletions

View File

@ -184,6 +184,19 @@ fn parses_json() {
assert_eq!(actual.out, "markup")
}
#[test]
fn parses_xml() {
let actual = nu!(
cwd: "tests/fixtures/formats",
"open jonathan.xml | get rss.children.channel.children | get item.children | get link.children.0.3.3.0"
);
assert_eq!(
actual.out,
"http://www.jonathanturner.org/2015/10/off-to-new-adventures.html"
)
}
#[test]
fn parses_ini() {
let actual = nu!(
@ -204,15 +217,19 @@ fn parses_utf16_ini() {
assert_eq!(actual.out, "-236")
}
// FIXME: jt: needs more work
#[ignore]
#[test]
fn errors_if_file_not_found() {
let actual = nu!(
cwd: "tests/fixtures/formats",
"open i_dont_exist.txt"
);
let expected = "Cannot find file";
#[cfg(windows)]
let expected = "The system cannot find the file specified. (os error 2)";
#[cfg(not(windows))]
let expected = "No such file or directory (os error 2)";
assert!(
actual.err.contains(expected),
"Error:\n{}\ndoes not contain{}",