From 738675259e21f30d869bb033b88fae364b14db4d Mon Sep 17 00:00:00 2001 From: Patrick Meredith Date: Mon, 26 Aug 2019 21:26:49 -0400 Subject: [PATCH] Improve test so that it should work on Windows --- tests/command_open_tests.rs | 4 ++-- tests/filters_test.rs | 4 ++-- tests/fixtures/formats/sample.bson | Bin 439 -> 521 bytes 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/command_open_tests.rs b/tests/command_open_tests.rs index bf33ec63f1..3f6da5adf5 100644 --- a/tests/command_open_tests.rs +++ b/tests/command_open_tests.rs @@ -28,7 +28,7 @@ fn open_can_parse_bson_1() { nu!( output, cwd("tests/fixtures/formats"), - "open sample.bson | nth 0 | get b | echo $it" + "open sample.bson | get root | nth 0 | get b | echo $it" ); assert_eq!(output, "hello"); @@ -39,7 +39,7 @@ fn open_can_parse_bson_2() { nu!( output, cwd("tests/fixtures/formats"), - "open sample.bson | nth 6 | get b | get '$binary_subtype' | echo $it " + "open sample.bson | get root | nth 6 | get b | get '$binary_subtype' | echo $it " ); assert_eq!(output, "function"); diff --git a/tests/filters_test.rs b/tests/filters_test.rs index ac68ea5fff..710f0b89a8 100644 --- a/tests/filters_test.rs +++ b/tests/filters_test.rs @@ -111,10 +111,10 @@ fn can_convert_json_text_to_bson_and_back_into_table() { nu!( output, cwd("tests/fixtures/formats"), - "echo '{\"root\":[{\"x\": 2, \"y\": 4}, {\"z\": \"42\"}]}' | from-json | to-bson | from-bson | get root | nth 1 | get z | echo $it" + "open sample.bson | to-bson | from-bson | get root | nth 1 | get b | echo $it" ); - assert_eq!(output, "42"); + assert_eq!(output, "whel"); } #[test] diff --git a/tests/fixtures/formats/sample.bson b/tests/fixtures/formats/sample.bson index 95c98eb4e1f1f8ec1517944c23045ba72b098940..951c805065e7d736a2238be45ad4f23ff9734dd5 100644 GIT binary patch delta 227 zcmdna+{vQE$;80G9-o=Q5S!96@gT?9O|5o0Cs~T}^Gg`sGBPkQ8!$}BWMVd)m|@Mt zY&3C^hCj10gBJr#PvW`z#fBBN0&f^?nUfd{f#OWb`6;Ok+(1@NYKcOHf~`WOH3M^T za(+Q7g8)#Ju@XptfPe##U^bb|%BaM|Y&uzuQOTRxjKK{k2ysr5nfJ`N%aejRwFQ|I o8Ki*Xm_{30Gcd3wfo)^VNX^N~S18Xf%1L2hHlN(YXbSWh0B{#FoB#j- delta 144 zcmeBV+0HysDRW|<)x^{4);0_b4D9ilDGafR=k6C9R@4f-VYKB>Vo(N(a|3ZsYKcOH zf~`WOHG=?<%UB5{KtRBOVX`Bm(&RKoMJsC{A7Vz5nfJ`N%aejRwFP+-QS=*IGq5Is WMHn+ub8_+(%JYkIQYK$wGz9