-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Account for the optional equality support of map/seq inside newt…
…ypes (#5980) This PR extends fix #5973 of issue #5972 to also handle newtypes, subset types, and type synonyms wrapped around map and sequence types. Fixes #5978 <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small> --------- Co-authored-by: Mikael Mayer <[email protected]> Co-authored-by: Mikaël Mayer <[email protected]>
- Loading branch information
1 parent
883ae1a
commit 648da0e
Showing
19 changed files
with
616 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
# Check for required environment variables | ||
if [ -z "$DIR" ]; then | ||
echo "Error: DIR environment variable is not set." | ||
exit 1 | ||
fi | ||
|
||
if [ -z "$name" ]; then | ||
echo "Error: name environment variable is not set." | ||
exit 1 | ||
fi | ||
|
||
# Set the default build flag | ||
NO_BUILD=${NO_BUILD:-false} | ||
|
||
# Locate files matching the specified pattern | ||
files=$(cd "${DIR}/Source/IntegrationTests/TestFiles/LitTests/LitTest" && find . -type f -wholename "*$name*" | grep -E '\.dfy$') | ||
|
||
if [ -z "$files" ]; then | ||
echo "No files found matching pattern: $name" | ||
exit 1 | ||
else | ||
count=$(echo "$files" | wc -l) | ||
echo "$files" | ||
echo "$count test files found." | ||
for file in $files; do | ||
filedir=$(dirname "$file") | ||
( | ||
cd "${DIR}/Source/IntegrationTests/TestFiles/LitTests/LitTest/$filedir" || exit | ||
|
||
build_flag="" | ||
[ "$NO_BUILD" = "true" ] && build_flag="--no-build" | ||
|
||
dotnet run $build_flag --project "${DIR}/Source/Dafny" -- ${action} "$(basename "$file")" | ||
) | ||
done | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Ensure name is provided | ||
if [ -z "$name" ]; then | ||
echo "Syntax: make test name=<integration test filter> [update=true] [build=false]" | ||
exit 1 | ||
fi | ||
|
||
# Default values for update and build | ||
update_flag=${update:-false} | ||
build_flag=${build:-true} | ||
|
||
# Set the integration tests folder | ||
integration_tests_dir="${DIR}/Source/IntegrationTests" | ||
lit_tests_dir="${integration_tests_dir}/TestFiles/LitTests/LitTest" | ||
|
||
# Handle no-build logic | ||
if [ "$build_flag" = "false" ]; then | ||
echo "" | ||
echo "Build is disabled. Copying test files to the output directory..." | ||
|
||
framework_dir=$(find "${integration_tests_dir}/bin/Debug" -maxdepth 1 -type d -name "net*" | sort | tail -n 1) | ||
if [ -z "$framework_dir" ]; then | ||
echo "Error: Could not find target framework directory in bin/Debug. Please run at least once with build=true." | ||
exit 1 | ||
fi | ||
output_dir="${framework_dir}/TestFiles/LitTests/LitTest" | ||
|
||
# Find and copy all matching files to the output directory | ||
files=$(cd "$lit_tests_dir" && find . -type f -regex '.*\.\(check\|dfy\|expect\)' -wholename "*$name*") | ||
if [ -z "$files" ]; then | ||
echo "No files found matching pattern: $name" | ||
exit 1 | ||
fi | ||
|
||
# Create output directory if it doesn't exist | ||
mkdir -p "$output_dir" | ||
|
||
# Copy files | ||
echo "$files" | while IFS= read -r file; do | ||
echo "Copying $file to $output_dir" | ||
cp "$lit_tests_dir/$file" "$output_dir/$file" | ||
done | ||
fi | ||
|
||
# Check if update flag is true | ||
if [ "$update_flag" = "true" ]; then | ||
echo "" | ||
echo "Update mode enabled." | ||
echo "Going to update the .expect files to match the current Dafny output." | ||
fi | ||
|
||
# Run dotnet test | ||
echo "Running integration tests..." | ||
DAFNY_INTEGRATION_TESTS_UPDATE_EXPECT_FILE="$update_flag" \ | ||
dotnet test "$integration_tests_dir" \ | ||
$( [ "$build_flag" = "false" ] && echo "--no-build" ) \ | ||
--filter "DisplayName~$name" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.