Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpolzin committed Dec 27, 2024
1 parent fa7fc47 commit c9ed4e9
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 18 deletions.
18 changes: 16 additions & 2 deletions tests/idris2/pkg/pkg006/expected
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
Error: Failed to resolve the dependencies for test3:
required foo >= 0.4 && < 0.5 but no matching version is installed
Required foo >= 0.4 && < 0.5 but no matching version is installed.

Searched for packages in:
[...]/tests/idris2/pkg/pkg006/depends
[...]/tests/idris2/pkg/pkg006/prefix/idris2-0.7.0
[...]/build/env/idris2-0.7.0

For more details on what packages Idris2 can locate, run `idris2 --list-packages`

Error: Failed to resolve the dependencies for test4:
required baz any but no matching version is installed
Required baz any but no matching version is installed.

Searched for packages in:
[...]/tests/idris2/pkg/pkg006/depends
[...]/tests/idris2/pkg/pkg006/prefix/idris2-0.7.0
[...]/build/env/idris2-0.7.0

For more details on what packages Idris2 can locate, run `idris2 --list-packages`

Warning: Deprecation warning: version numbers must now be of the form x.y.z
16 changes: 11 additions & 5 deletions tests/idris2/pkg/pkg006/run
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ for folder in ./depends/*; do
mkdir -p "${folder}/${TTC_VERSION}"
done

idris2 --build test1.ipkg 2>&1
idris2 --build test2.ipkg 2>&1
idris2 --build test3.ipkg 2>&1
idris2 --build test4.ipkg 2>&1
idris2 --build test5.ipkg 2>&1
TEST_PREFIX="$(cd ../../../.. && pwd)"

fix_path() {
sed "s#$TEST_PREFIX#[...]#g" | windows_path_tweaks
}

idris2 --build test1.ipkg 2>&1 | fix_path
idris2 --build test2.ipkg 2>&1 | fix_path
idris2 --build test3.ipkg 2>&1 | fix_path
idris2 --build test4.ipkg 2>&1 | fix_path
idris2 --build test5.ipkg 2>&1 | fix_path

for folder in ./depends/*; do
rmdir "${folder}/${TTC_VERSION}"
Expand Down
15 changes: 11 additions & 4 deletions tests/idris2/pkg/pkg015/expected
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Error: Failed to resolve the dependencies for test:
foo-0.2.0; baz-0.3.0; required quux any but no matching version is installed
foo-0.2.0; baz-0.2.0; bar-0.1.1; required baz < 0.2.0 but assigned version 0.2.0 which is out of bounds
foo-0.2.0; baz-0.2.0; bar-0.1.0; required prz > 0.1.0 but no matching version is installed
foo-0.1.0; required baz < 0.1.0 but no matching version is installed
Required quux any but no matching version is installed. Resolved transitive dependencies: foo-0.2.0; baz-0.3.0.
Required baz < 0.2.0 but only found version 0.2.0 which is out of bounds. Resolved transitive dependencies: foo-0.2.0; baz-0.2.0; bar-0.1.1.
Required prz > 0.1.0 but no matching version is installed. Resolved transitive dependencies: foo-0.2.0; baz-0.2.0; bar-0.1.0.
Required baz < 0.1.0 but no matching version is installed. Resolved transitive dependencies: foo-0.1.0.

Searched for packages in:
[...]/tests/idris2/pkg/pkg015/depends
[...]/tests/idris2/pkg/pkg015/prefix/idris2-0.7.0
[...]/build/env/idris2-0.7.0

For more details on what packages Idris2 can locate, run `idris2 --list-packages`

8 changes: 7 additions & 1 deletion tests/idris2/pkg/pkg015/run
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ for folder in ./depends/*; do
mkdir -p "${folder}/${TTC_VERSION}"
done

idris2 --build test.ipkg --log package.depends:10 2>&1
TEST_PREFIX="$(cd ../../../.. && pwd)"

fix_path() {
windows_path_tweaks | sed "s#$TEST_PREFIX#[...]#g"
}

idris2 --build test.ipkg --log package.depends:10 2>&1 | fix_path

for folder in ./depends/*; do
rmdir "${folder}/${TTC_VERSION}"
Expand Down
8 changes: 2 additions & 6 deletions tests/idris2/pkg/pkg020/run
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
. ../../../testutils.sh

windows_tweaks() {
sed 's#C:.msys64##' | sed 's#\\#/#g'
}

# pretend Idris2 is installed at root for reproducible
# installdirs:
IDRIS2_PREFIX=/ idris2 --dump-installdir test.ipkg \
| windows_tweaks
| windows_path_tweaks

# by contrast, the location containing all installed packages:
IDRIS2_PREFIX=/ idris2 --libdir \
| windows_tweaks
| windows_path_tweaks
4 changes: 4 additions & 0 deletions tests/testutils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ sed_literal() {
printf '%s\n' "$1" | sed -e 's/[]\/$*.^[]/\\&/g'
}

windows_path_tweaks() {
sed 's#C:.msys64##' | sed 's#\\#/#g'
}

# used below to normalise machine names
# shellcheck disable=SC2016
_awk_clean_name='
Expand Down

0 comments on commit c9ed4e9

Please sign in to comment.