diff --git a/.travis.yml b/.travis.yml index aad1da9..ddab849 100644 --- a/.travis.yml +++ b/.travis.yml @@ -60,8 +60,12 @@ matrix: #- env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1 # Windows - - env: TARGET=x86_64-pc-windows-gnu - - env: TARGET=i686-pc-windows-gnu + - env: + - TARGET=x86_64-pc-windows-gnu + - SKIP_TESTS="test_resolve_consistency test_resolve_unicode" + - env: + - TARGET=i686-pc-windows-gnu + - SKIP_TESTS="test_resolve_consistency test_resolve_unicode" # Bare metal # These targets don't support std and as such are likely not suitable for diff --git a/ci/script.sh b/ci/script.sh old mode 100644 new mode 100755 index 47fa076..dc3470c --- a/ci/script.sh +++ b/ci/script.sh @@ -11,11 +11,15 @@ main() { fi if [ "$TARGET" = "x86_64-apple-darwin" ] && [ "$TRAVIS_OS_NAME" = osx ]; then - cargo test - cargo test --release + cargo test + cargo test --release else - cross test --target $TARGET -- --skip test_resolve_consistency - cross test --target $TARGET --release -- --skip test_resolve_consistency + local skip=() + for s in ${SKIP_TESTS:-test_resolve_consistency}; do + if [ -n $s ]; then skip=("${skip[@]}" --skip $s); fi + done + cross test --target $TARGET -- "${skip[@]}" + cross test --target $TARGET --release -- "${skip[@]}" fi } diff --git a/pax/src/test/mod.rs b/pax/src/test/mod.rs index a83b8dc..4ce8692 100644 --- a/pax/src/test/mod.rs +++ b/pax/src/test/mod.rs @@ -286,6 +286,10 @@ fn assert_resolves(context: &str, from: &str, to: Option<&str>, input_options: & fn test_resolve() { test_resolve_with(assert_resolves); } +#[test] +fn test_resolve_unicode() { + test_resolve_unicode_with(assert_resolves); +} fn test_resolve_with(mut assert_resolves: F) where F: FnMut(&str, &str, Option<&str>, &InputOptions) { let cjs = InputOptions { @@ -1136,11 +1140,6 @@ where F: FnMut(&str, &str, Option<&str>, &InputOptions) { Some("resolve/subdir/subdir2/node_modules/shadowed/index.js"), &cjs); let ctx = "resolve/hypothetical.js"; - assert_resolves(ctx, "./unicode/𝌆", - Some("resolve/unicode/𝌆.js"), &cjs); - assert_resolves(ctx, "./unicode/𝌆.js", - Some("resolve/unicode/𝌆.js"), &cjs); - assert_resolves(ctx, "./dotfiles", None, &cjs); assert_resolves(ctx, "./dotfiles/", None, &esm); @@ -1200,6 +1199,22 @@ where F: FnMut(&str, &str, Option<&str>, &InputOptions) { Some("resolve-order/4-dir/index.json"), &cjs); } +fn test_resolve_unicode_with(mut assert_resolves: F) +where F: FnMut(&str, &str, Option<&str>, &InputOptions) { + let cjs = InputOptions { + for_browser: false, + es6_syntax: false, + es6_syntax_everywhere: false, + external: Default::default(), + }; + + let ctx = "resolve/hypothetical.js"; + assert_resolves(ctx, "./unicode/𝌆", + Some("resolve/unicode/𝌆.js"), &cjs); + assert_resolves(ctx, "./unicode/𝌆.js", + Some("resolve/unicode/𝌆.js"), &cjs); +} + #[test] fn test_resolve_consistency() { // meta-test: ensure test_resolve matches node behavior @@ -1211,7 +1226,7 @@ fn test_resolve_consistency() { let mut esm = FnvHashMap::default(); { - let append = |ctx: &str, from: &str, to: Option<&str>, input_options: &InputOptions| { + let mut append = |ctx: &str, from: &str, to: Option<&str>, input_options: &InputOptions| { let assertions = if input_options.es6_syntax { &mut esm } else { @@ -1222,7 +1237,8 @@ fn test_resolve_consistency() { .insert((from.to_owned(), to.map(ToOwned::to_owned))); }; - test_resolve_with(append); + test_resolve_with(&mut append); + test_resolve_unicode_with(&mut append); } fn make_source(base: &Path, cases: &Cases) -> Vec {