diff --git a/Cargo.lock b/Cargo.lock index ff16682514..3215ea8508 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1631,7 +1631,7 @@ dependencies = [ [[package]] name = "nu" -version = "0.1.2" +version = "0.1.3" dependencies = [ "adhoc_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "ansi_term 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1680,6 +1680,7 @@ dependencies = [ "reqwest 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)", "roxmltree 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustyline 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.94 (registry+https://github.com/rust-lang/crates.io-index)", "serde-hjson 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde_bytes 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 5e848b4b69..21d32ad171 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nu" -version = "0.1.2" +version = "0.1.3" authors = ["Yehuda Katz ", "Jonathan Turner "] description = "A shell for the GitHub era" license = "MIT" @@ -74,6 +74,7 @@ rawkey = "0.1.1" crossterm = "0.9.6" tempfile = "3.1.0" image = "0.21.2" +semver = "0.9.0" [dev-dependencies] pretty_assertions = "0.6.1" diff --git a/tests/filters_test.rs b/tests/filters_test.rs index a4f8d639c5..98ec17298f 100644 --- a/tests/filters_test.rs +++ b/tests/filters_test.rs @@ -13,13 +13,26 @@ fn can_convert_table_to_json_text_and_from_json_text_back_into_table() { #[test] fn can_convert_table_to_toml_text_and_from_toml_text_back_into_table() { - nu!(output, + nu!( + output, cwd("tests/fixtures/formats"), - "open cargo_sample.toml | to-toml | from-toml | get package.name | echo $it"); + "open cargo_sample.toml | to-toml | from-toml | get package.name | echo $it" + ); assert_eq!(output, "nu"); } +#[test] +fn can_convert_table_to_yaml_text_and_from_yaml_text_back_into_table() { + nu!( + output, + cwd("tests/fixtures/formats"), + "open appveyor.yml | to-yaml | from-yaml | get environment.global.PROJECT_NAME | echo $it" + ); + + assert_eq!(output, "nushell"); +} + #[test] fn can_sort_by_column() { nu!(output, @@ -40,9 +53,11 @@ fn can_split_by_column() { #[test] fn can_filter_by_unit_size_comparison() { - nu!(output, + nu!( + output, cwd("tests/fixtures/formats"), - "ls | where size > 1kb | get name | trim | echo $it"); + "ls | where size > 1kb | get name | trim | echo $it" + ); assert_eq!(output, "cargo_sample.toml"); } diff --git a/tests/fixtures/formats/appveyor.yml b/tests/fixtures/formats/appveyor.yml new file mode 100644 index 0000000000..770f32a2a9 --- /dev/null +++ b/tests/fixtures/formats/appveyor.yml @@ -0,0 +1,31 @@ +image: Visual Studio 2017 + +environment: + global: + PROJECT_NAME: nushell + RUST_BACKTRACE: 1 + matrix: + - TARGET: x86_64-pc-windows-msvc + CHANNEL: nightly + BITS: 64 + +install: + - set PATH=C:\msys64\mingw%BITS%\bin;C:\msys64\usr\bin;%PATH% + - curl -sSf -o rustup-init.exe https://win.rustup.rs + # Install rust + - rustup-init.exe -y --default-host %TARGET% --default-toolchain %CHANNEL%-%TARGET% + - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin + # Required for Racer autoconfiguration + - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" + + +build: false + +test_script: + # compile #[cfg(not(test))] code + - cargo build --verbose + - cargo test --all --verbose + +cache: + - target -> Cargo.lock + - C:\Users\appveyor\.cargo\registry -> Cargo.lock