From f5e07b696b6d70b8b948a26bd894f202781310bb Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 5 Apr 2024 16:50:38 +0200 Subject: [PATCH 01/26] Deprecate unicode-char --- Source/DafnyCore/Options/CommonOptionBag.cs | 1 + Source/DafnyCore/Verifier/BoogieGenerator.cs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Source/DafnyCore/Options/CommonOptionBag.cs b/Source/DafnyCore/Options/CommonOptionBag.cs index a38e9e20c10..a1f1087beb0 100644 --- a/Source/DafnyCore/Options/CommonOptionBag.cs +++ b/Source/DafnyCore/Options/CommonOptionBag.cs @@ -195,6 +195,7 @@ Note that quantifier variable domains (<- ) are available in both syntax @" false - The char type represents any UTF-16 code unit. true - The char type represents any Unicode scalar value.".TrimStart()) { + IsHidden = true }; public static readonly Option AllowAxioms = new("--allow-axioms", () => false, diff --git a/Source/DafnyCore/Verifier/BoogieGenerator.cs b/Source/DafnyCore/Verifier/BoogieGenerator.cs index 115116be897..7bc9b3e5d7b 100644 --- a/Source/DafnyCore/Verifier/BoogieGenerator.cs +++ b/Source/DafnyCore/Verifier/BoogieGenerator.cs @@ -672,6 +672,9 @@ Bpl.Program ReadPrelude() { } if (options.Get(CommonOptionBag.UnicodeCharacters)) { defines.Add("UNICODE_CHAR"); + } else { + reporter.Deprecated(MessageSource.Verifier, null, options.DafnyProject.StartingToken, + "the option unicode-char has been deprecated."); } int errorCount = BplParser.Parse(preludePath, defines, out var prelude); if (prelude == null || errorCount > 0) { From ae3414d580f631c5d1fac60eafa7bde797bad282 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 5 Apr 2024 16:51:31 +0200 Subject: [PATCH 02/26] Add release note --- docs/dev/news/5302.feat | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/dev/news/5302.feat diff --git a/docs/dev/news/5302.feat b/docs/dev/news/5302.feat new file mode 100644 index 00000000000..ac20c5b4edb --- /dev/null +++ b/docs/dev/news/5302.feat @@ -0,0 +1 @@ +Deprecated the unicode-char option \ No newline at end of file From 24e8c4f16efc68b30059c0df199c3781e82bc51f Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 5 Apr 2024 17:40:30 +0200 Subject: [PATCH 03/26] Fix bugs --- Source/DafnyCore/Generic/ErrorReporter.cs | 10 ++++++++++ Source/DafnyCore/Verifier/BoogieGenerator.cs | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/DafnyCore/Generic/ErrorReporter.cs b/Source/DafnyCore/Generic/ErrorReporter.cs index f13a2e053dc..28ad1f15688 100644 --- a/Source/DafnyCore/Generic/ErrorReporter.cs +++ b/Source/DafnyCore/Generic/ErrorReporter.cs @@ -154,6 +154,16 @@ public void Warning(MessageSource source, string errorId, IToken tok, string msg Message(source, ErrorLevel.Warning, errorId, tok, msg); } + public void Deprecated(MessageSource source, string errorId, IToken tok, string msg) { + Contract.Requires(tok != null); + Contract.Requires(msg != null); + if (Options.DeprecationNoise != 0) { + Warning(source, errorId, tok, msg); + } else { + Info(source, tok, msg, errorId); + } + } + public void Deprecated(MessageSource source, Enum errorId, IToken tok, string msg) { Contract.Requires(tok != null); Contract.Requires(msg != null); diff --git a/Source/DafnyCore/Verifier/BoogieGenerator.cs b/Source/DafnyCore/Verifier/BoogieGenerator.cs index 7bc9b3e5d7b..83e21633a47 100644 --- a/Source/DafnyCore/Verifier/BoogieGenerator.cs +++ b/Source/DafnyCore/Verifier/BoogieGenerator.cs @@ -673,7 +673,7 @@ Bpl.Program ReadPrelude() { if (options.Get(CommonOptionBag.UnicodeCharacters)) { defines.Add("UNICODE_CHAR"); } else { - reporter.Deprecated(MessageSource.Verifier, null, options.DafnyProject.StartingToken, + reporter.Deprecated(MessageSource.Verifier, "unicodeCharDeprecated", Token.Cli, "the option unicode-char has been deprecated."); } int errorCount = BplParser.Parse(preludePath, defines, out var prelude); From 00ba51f60dcbece9abafb888f5c1f6ac297ecd0d Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Mon, 8 Apr 2024 12:37:44 +0200 Subject: [PATCH 04/26] Update expect files --- .../DafnyTests/RunAllTests/RunAllTestsOption.dfy | 12 ++++++------ ...estGenerationNoInliningEnumerativeDefinitions.dfy | 4 ++-- ...stGenerationWithInliningQuantifiedDefinitions.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/arrays.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/bit-vectors.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/class.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/const.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/datatypes.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/generic.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/hello.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/ints.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/maps.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/recursion.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/returns.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/seqs.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/sets.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/while.dfy | 2 +- .../TestFiles/LitTests/LitTest/comp/Arrays.dfy | 2 +- .../TestFiles/LitTests/LitTest/comp/Collections.dfy | 2 +- .../LitTests/LitTest/comp/CompileWithArguments.dfy | 4 ++-- .../LitTests/LitTest/comp/Comprehensions.dfy | 2 +- .../LitTests/LitTest/comp/ErasableTypeWrappers.dfy | 2 +- .../LitTests/LitTest/comp/NativeNumbers.dfy | 2 +- .../TestFiles/LitTests/LitTest/comp/Numbers.dfy | 2 +- .../LitTest/contract-wrappers/AllExterns.dfy | 2 +- .../LitTest/dafny0/ArrayElementInitCompile.dfy | 2 +- .../LitTests/LitTest/git-issues/git-issue-1100.dfy | 2 +- .../LitTests/LitTest/git-issues/git-issue-258.dfy | 2 +- .../LitTests/LitTest/git-issues/git-issue-2733.dfy | 2 +- .../LitTests/LitTest/git-issues/git-issue-356.dfy | 2 +- .../LitTests/LitTest/git-issues/git-issue-3571.dfy | 2 +- .../LitTest/git-issues/github-issue-2989.dfy | 2 +- .../LitTests/LitTest/separate-verification/app.dfy | 2 +- .../LitTest/stdlibs/StandardLibraries_Errors.dfy | 2 +- 34 files changed, 41 insertions(+), 41 deletions(-) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy index cb3a77e1611..bfe93c65475 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy @@ -1,11 +1,11 @@ // RUN: %verify "%s" > "%t" -// RUN: %translate cs %args %s --include-runtime --include-test-runner --unicode-char false --no-verify --output %S/Output/manual/program.cs >> "%t" +// RUN: %translate cs %args %s --include-runtime --include-test-runner --allow-deprecation --unicode-char false --no-verify --output %S/Output/manual/program.cs >> "%t" // RUN: ! dotnet run -v q --property WarningLevel=0 --project %S/RunAllTests.csproj >> "%t" -// RUN: ! %baredafny test %args --unicode-char:false --no-verify --target:cs "%s" >> "%t" -// RUN: ! %baredafny test %args --unicode-char:false --no-verify --target:java "%s" >> "%t" -// RUN: ! %baredafny test %args --unicode-char:false --no-verify --target:go "%s" >> "%t" -// RUN: ! %baredafny test %args --unicode-char:false --no-verify --target:js "%s" >> "%t" -// RUN: ! %baredafny test %args --unicode-char:false --no-verify --target:py "%s" >> "%t" +// RUN: ! %baredafny test %args --allow-deprecation --unicode-char:false --no-verify --target:cs "%s" >> "%t" +// RUN: ! %baredafny test %args --allow-deprecation --unicode-char:false --no-verify --target:java "%s" >> "%t" +// RUN: ! %baredafny test %args --allow-deprecation --unicode-char:false --no-verify --target:go "%s" >> "%t" +// RUN: ! %baredafny test %args --allow-deprecation --unicode-char:false --no-verify --target:js "%s" >> "%t" +// RUN: ! %baredafny test %args --allow-deprecation --unicode-char:false --no-verify --target:py "%s" >> "%t" // RUN: %diff "%s.expect" "%t" include "../../exceptions/VoidOutcomeDt.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationNoInliningEnumerativeDefinitions.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationNoInliningEnumerativeDefinitions.dfy index 2fa887a2606..fdd509d814d 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationNoInliningEnumerativeDefinitions.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationNoInliningEnumerativeDefinitions.dfy @@ -1,11 +1,11 @@ // Generating and Running Block-Based Tests: // RUN: %baredafny generate-tests %args Block %S/TestGenerationNoInliningEnumerativeDefinitions.dfy > %t-tests.dfy -// RUN: %baredafny test %args --unicode-char:false --target:cs "%t-tests.dfy" >> "%t" +// RUN: %baredafny test %args --allow-deprecation --unicode-char:false --target:cs "%t-tests.dfy" >> "%t" // Generating and Running Path-Based Tests: // RUN: %baredafny generate-tests %args Path %S/TestGenerationNoInliningEnumerativeDefinitions.dfy > %t-tests.dfy -// RUN: %baredafny test %args --unicode-char:false --target:cs "%t-tests.dfy" >> "%t" +// RUN: %baredafny test %args --allow-deprecation --unicode-char:false --target:cs "%t-tests.dfy" >> "%t" // RUN: %OutputCheck --file-to-check "%t" "%s" // CHECK: .*Dafny program verifier finished with 2 verified, 0 errors* diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationWithInliningQuantifiedDefinitions.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationWithInliningQuantifiedDefinitions.dfy index 7407edba63c..963c7e7f95c 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationWithInliningQuantifiedDefinitions.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationWithInliningQuantifiedDefinitions.dfy @@ -1,6 +1,6 @@ // Generating and Running Path-Based Tests: // RUN: %baredafny generate-tests %args Path %S/TestGenerationWithInliningQuantifiedDefinitions.dfy > %t-tests.dfy -// RUN: %baredafny test %args --unicode-char:false --target:cs "%t-tests.dfy" >> "%t" +// RUN: %baredafny test %args --allow-deprecation --unicode-char:false --target:cs "%t-tests.dfy" >> "%t" // RUN: %OutputCheck --file-to-check "%t" "%s" // CHECK: .*Dafny program verifier finished with 5 verified, 0 errors* diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/arrays.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/arrays.dfy index 196ffc8f61e..c35460efc6f 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/arrays.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/arrays.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char:false newtype uint32 = i:int | 0 <= i < 0x100000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/bit-vectors.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/bit-vectors.dfy index 405b766f34e..701cf1c99c5 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/bit-vectors.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/bit-vectors.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false newtype uint64 = i:int | 0 <= i < 0x10000000000000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/class.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/class.dfy index 296da3b43b6..5aefab47194 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/class.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/class.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false newtype uint32 = i:int | 0 <= i < 0x100000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/const.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/const.dfy index fdc2b7a1d9d..3ca8fb1c46e 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/const.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/const.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false module Holder { const x:bool := false diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/datatypes.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/datatypes.dfy index 7c98014a73c..89d373f23cb 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/datatypes.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/datatypes.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false newtype uint32 = i:int | 0 <= i < 0x100000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/generic.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/generic.dfy index 55d613fed56..7adc6be08e7 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/generic.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/generic.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false class Test { var t:T diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/hello.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/hello.dfy index 9257e899a27..7f6cf623425 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/hello.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/hello.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false method Main() { print "Hello world\n"; diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/ints.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/ints.dfy index 4162b5b08d3..7e4a5a0360d 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/ints.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/ints.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false newtype sbyte = i:int | -0x80 <= i < 0x80 newtype byte = i:int | 0 <= i < 0x100 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/maps.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/maps.dfy index 841bbf699b6..2d32b1808c3 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/maps.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/maps.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false newtype uint32 = i:int | 0 <= i < 0x100000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/recursion.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/recursion.dfy index 6eaab6072ad..34f9c2a4b12 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/recursion.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/recursion.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false newtype uint32 = i:int | 0 <= i < 0x100000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/returns.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/returns.dfy index e4603f58bda..a613b0d934f 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/returns.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/returns.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false newtype uint64 = i:int | 0 <= i < 0x10000000000000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/seqs.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/seqs.dfy index 6218f8b60b1..1dbd6998367 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/seqs.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/seqs.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false newtype uint8 = i:int | 0 <= i < 0x100 newtype uint32 = i:int | 0 <= i < 0x100000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/sets.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/sets.dfy index 1ae06ab230e..c72b1b0f31f 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/sets.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/sets.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false newtype uint32 = i:int | 0 <= i < 0x100000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/while.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/while.dfy index 17a533a844a..5fbec60660b 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/while.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/while.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false newtype uint32 = i:int | 0 <= i < 0x100000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Arrays.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Arrays.dfy index 26f4169388c..d062529db1b 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Arrays.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Arrays.dfy @@ -1,5 +1,5 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/2582 -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char:false method LinearSearch(a: array, key: int) returns (n: nat) ensures 0 <= n <= a.Length diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy index 9fbca4d5fdb..0a27b36b64e 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy @@ -1,5 +1,5 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4108 -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false method Main() { Sets(); diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArguments.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArguments.dfy index 25baebae411..2a808d7795e 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArguments.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArguments.dfy @@ -1,7 +1,7 @@ // NONUNIFORM: Multiple testing scenarios, highly backend sensitive, testing CLI // RUN: %verify "%s" > "%t" // RUN: %run --no-verify --target:cs "%s" Csharp 1 >> "%t" -// RUN: %run --no-verify --target:cpp --unicode-char:false "%s" Cpp Yipee >> "%t" +// RUN: %run --no-verify --target:cpp --allow-deprecation --unicode-char:false "%s" Cpp Yipee >> "%t" // RUN: %run --no-verify --target:java "%s" -- Java --heya >> "%t" // RUN: %run --no-verify --target:js "%s" -- Javascript 2 >> "%t" // RUN: %run --no-verify --target py "%s" Python 1 >> "%t" @@ -14,7 +14,7 @@ // RUN: node %s.js "javascript" 2 >> "%t" // RUN: node %s.js "javascript" 1 >> "%t" // RUN: node %s.js "javascript" "aloha" >> "%t" -// RUN: %build --no-verify --target:cpp --unicode-char:false "%s" --output=%s.exe +// RUN: %build --no-verify --target:cpp --allow-deprecation --unicode-char:false "%s" --output=%s.exe // RUN: %s.exe "cpp" 2 >> "%t" // RUN: %s.exe "cpp" 1 >> "%t" // RUN: %s.exe "cpp" "aloha" >> "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Comprehensions.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Comprehensions.dfy index e37d556b24a..dcbca9e37cb 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Comprehensions.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Comprehensions.dfy @@ -1,5 +1,5 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4108 -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false method Main() { AssignSuchThat(); diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy index d2ef145f661..6fe56c10bc1 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false --type-system-refresh --general-traits=datatype +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false --type-system-refresh --general-traits=datatype datatype SingletonRecord = SingletonRecord(u: int) datatype GhostOrNot = ghost Ghost(a: int, b: int) | Compiled(x: int) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/NativeNumbers.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/NativeNumbers.dfy index 4b6e5c7ca5d..2c98a98ff04 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/NativeNumbers.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/NativeNumbers.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false // Skip JavaScript because JavaScript doesn't have the same native types diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy index b1a73ee6e08..e7f31ea0723 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy @@ -1,5 +1,5 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4174 -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char:false method Main() { Literals(); diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/contract-wrappers/AllExterns.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/contract-wrappers/AllExterns.dfy index f594df80039..a269eb67e5d 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/contract-wrappers/AllExterns.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/contract-wrappers/AllExterns.dfy @@ -1,4 +1,4 @@ -// RUN: ! %baredafny test %args --unicode-char:false --allow-warnings --test-assumptions=externs %s %s.externs.cs > %t +// RUN: ! %baredafny test %args --allow-deprecation --unicode-char:false --allow-warnings --test-assumptions=externs %s %s.externs.cs > %t // RUN: %diff "%s.expect" "%t" // RUN: %OutputCheck --file-to-check "%S/AllExterns.cs" "%s" // CHECK: .*Foo____dafny__checked\(x\).* diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInitCompile.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInitCompile.dfy index bb0c53e29ff..4eb2e93635b 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInitCompile.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInitCompile.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char:false method Main() { diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1100.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1100.dfy index 85c499119aa..1ade09660a1 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1100.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1100.dfy @@ -1,3 +1,3 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%S/../c++/arrays.dfy" -- --relax-definite-assignment --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%S/../c++/arrays.dfy" -- --relax-definite-assignment --allow-deprecation --unicode-char:false // Test compilation of a file in another directory diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-258.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-258.dfy index 9f85b1135fc..cd62af53e5d 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-258.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-258.dfy @@ -1,5 +1,5 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/2582 -// RUN: %testDafnyForEachCompiler "%s" -- --relax-definite-assignment --spill-translation --unicode-char:false +// RUN: %testDafnyForEachCompiler "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false method pr(s: seq) { print s, "\n"; diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-2733.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-2733.dfy index b8bd1145a46..5cab415474e 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-2733.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-2733.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char:false method Main() { print "XYZ"; // Checks that no extra newline is added to the output diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-356.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-356.dfy index b6ba67ea01c..3acc92f652d 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-356.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-356.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char:false module M { type Tx = i: int | 0 <= i <= 100 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-3571.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-3571.dfy index 765e1ea12e1..cfeee97544d 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-3571.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-3571.dfy @@ -2,7 +2,7 @@ // RUN: %resolve --function-syntax:4 --function-syntax:3 "%s" > "%t" // RUN: %resolve --quantifier-syntax:3 --quantifier-syntax:4 "%s" >> "%t" // RUN: %build --target:java --target:cs "%s" >> "%t" -// RUN: %resolve --unicode-char:false --unicode-char:true "%s" >> "%t" +// RUN: %resolve --allow-deprecation --unicode-char:false --unicode-char:true "%s" >> "%t" // RUN: %resolve --prelude "%s" --prelude "%s" "%s" >> "%t" // RUN: %verify --cores:2 --cores:1 "%s" >> "%t" // RUN: %verify --solver-log x.tct --solver-log y.txt "%s" >> "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2989.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2989.dfy index 7618282314a..14d62ec1210 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2989.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2989.dfy @@ -1,5 +1,5 @@ // NONUNIFORM: Go-specific regression test -// RUN: %baredafny translate go %args --unicode-char:false "%s" > "%t" +// RUN: %baredafny translate go %args --allow-deprecation --unicode-char:false "%s" > "%t" // RUN: %baredafny translate go %args --unicode-char:true "%s" >> "%t" // RUN: %diff "%s.expect" "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/separate-verification/app.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/separate-verification/app.dfy index def0661599a..b57a06ce9a2 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/separate-verification/app.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/separate-verification/app.dfy @@ -20,7 +20,7 @@ // Error cases: mismatched options // RUN: %baredafny build %args -t:lib --unicode-char:true %S/Inputs/wrappers.dfy -// RUN: ! %baredafny build %args -t:lib --unicode-char:false %S/Inputs/seq.dfy --library %S/Inputs/wrappers.doo >> %t +// RUN: ! %baredafny build %args -t:lib --allow-deprecation --unicode-char:false %S/Inputs/seq.dfy --library %S/Inputs/wrappers.doo >> %t // RUN: %baredafny build %args -t:lib --boogie /vcsLoad:2 %S/Inputs/wrappers.dfy // RUN: ! %baredafny build %args -t:lib %S/Inputs/seq.dfy --library %S/Inputs/wrappers.doo >> %t diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/stdlibs/StandardLibraries_Errors.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/stdlibs/StandardLibraries_Errors.dfy index 2256ae6f3d0..7131cbde0f1 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/stdlibs/StandardLibraries_Errors.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/stdlibs/StandardLibraries_Errors.dfy @@ -11,7 +11,7 @@ // Invalid: // RUN: %exits-with 2 %verify "%s" >> "%t" -// RUN: %exits-with 1 %verify --standard-libraries:true --unicode-char:false "%s" >> "%t" +// RUN: %exits-with 1 %verify --standard-libraries:true --allow-deprecation --unicode-char:false "%s" >> "%t" // RUN: %exits-with 1 %baredafny format --standard-libraries "%s" 2>> "%t" // RUN: %diff "%s.expect" "%t" From 2e7a50b08670e950747f705d76f8f29da1d860d6 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Mon, 8 Apr 2024 12:49:41 +0200 Subject: [PATCH 05/26] Remove --unicode-code false where possible --- .../TestFiles/LitTests/LitTest/c++/extern.dfy | 2 +- .../LitTests/LitTest/c++/functions.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/tuple.dfy | 2 +- .../LitTest/comp/ExternDafnyString.dfy | 2 +- .../LitTest/comp/ExternJavaString.dfy | 2 +- .../LitTests/LitTest/comp/JsModule.dfy | 2 +- .../TestFiles/LitTests/LitTest/comp/Print.dfy | 10 ++++---- .../comp/compile1quiet/CompileRunQuietly.dfy | 12 +++++----- .../compile1verbose/CompileAndThenRun.dfy | 12 +++++----- .../LitTest/comp/compile3/JustRun.dfy | 24 +++++++++---------- .../standardLibraryOptionMismatch.dfy | 2 +- .../examples/Simple_compiler/Compiler.dfy | 2 +- .../expectations/ExpectAndExceptions.dfy | 8 +++---- .../ExpectAndExceptions.dfy.expect | 8 +++---- .../ExpectWithNonStringMessage.dfy | 12 +++++----- .../ExpectWithNonStringMessage.dfy.expect | 10 ++++---- .../git-issues/git-issue-1151-more.dfy | 14 +++++------ .../git-issues/git-issue-356-errors.dfy | 2 +- .../LitTests/LitTest/wishlist/GoModule.dfy | 2 +- 19 files changed, 65 insertions(+), 65 deletions(-) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/extern.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/extern.dfy index d3207091368..0eaec93f859 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/extern.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/extern.dfy @@ -1,4 +1,4 @@ -// RUN: %run --target cpp --unicode-char false "%s" --input ExternDefs.h > "%t" +// RUN: %run --target cpp --allow-deprecation --unicode-char false "%s" --input ExternDefs.h > "%t" // RUN: %diff "%s.expect" "%t" module {:extern "Extern"} Extern { diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/functions.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/functions.dfy index a5a0c657210..c3a166b2cff 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/functions.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/functions.dfy @@ -1,4 +1,4 @@ -// RUN: %run --target cpp --unicode-char false "%s" --input ExternDefs.h > "%t" +// RUN: %run --target cpp --allow-deprecation --unicode-char false "%s" --input ExternDefs.h > "%t" // RUN: %diff "%s.expect" "%t" module {:extern "Extern"} Extern { diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/tuple.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/tuple.dfy index 9f2997cfaa9..829139e4106 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/tuple.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/tuple.dfy @@ -1,4 +1,4 @@ -// RUN: %run --target cpp --unicode-char false --input ExternDefs.h "%s" > "%t" +// RUN: %run --target cpp --allow-deprecation --unicode-char false --input ExternDefs.h "%s" > "%t" // RUN: %diff "%s.expect" "%t" newtype uint32 = i:int | 0 <= i < 0x100000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternDafnyString.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternDafnyString.dfy index ec0cfa8386c..be8aa8e0d9c 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternDafnyString.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternDafnyString.dfy @@ -1,4 +1,4 @@ -// RUN: %run --unicode-char false --target java "%s" --input %S/Conversions.java --input %S/ExternDafnyString.java > "%t" +// RUN: %run --allow-deprecation --unicode-char false --target java "%s" --input %S/Conversions.java --input %S/ExternDafnyString.java > "%t" // RUN: %diff "%s.expect" "%t" // In this example, the extern method obtains a Java string and returns it as a Dafny string. diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternJavaString.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternJavaString.dfy index c92aff84083..16585c64c99 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternJavaString.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternJavaString.dfy @@ -1,4 +1,4 @@ -// RUN: %run --unicode-char false --target java "%s" --input %S/Conversions.java --input %S/ExternJavaString.java > "%t" +// RUN: %run --allow-deprecation --unicode-char false --target java "%s" --input %S/Conversions.java --input %S/ExternJavaString.java > "%t" // RUN: %diff "%s.expect" "%t" // In this example, the extern method obtains a Java string and returns it as such. // The Dafny code converts that Java string to a Dafny string. diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/JsModule.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/JsModule.dfy index 961d3921ab7..13fa069f498 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/JsModule.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/JsModule.dfy @@ -1,5 +1,5 @@ // NONUNIFORM: Javascript-specific extern test -// RUN: %run --unicode-char false --target js "%s" > "%t" +// RUN: %run --allow-deprecation --unicode-char false --target js "%s" > "%t" // RUN: %diff "%s.expect" "%t" // "url" is a built-in package in node, so it should be accessible to the diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Print.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Print.dfy index 3eddc3ce15a..c1df38d639d 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Print.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Print.dfy @@ -1,9 +1,9 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4108 and https://github.com/dafny-lang/dafny/issues/2582 -// RUN: %verify --unicode-char false --relax-definite-assignment "%s" > "%t" -// RUN: %run --no-verify --unicode-char false --target cs "%s" >> "%t" -// RUN: %run --no-verify --unicode-char false --target js "%s" >> "%t" -// RUN: %run --no-verify --unicode-char false --target go "%s" >> "%t" -// RUN: %run --no-verify --unicode-char false --target java "%s" >> "%t" +// RUN: %verify --allow-deprecation --unicode-char false --relax-definite-assignment "%s" > "%t" +// RUN: %run --no-verify --allow-deprecation --unicode-char false --target cs "%s" >> "%t" +// RUN: %run --no-verify --allow-deprecation --unicode-char false --target js "%s" >> "%t" +// RUN: %run --no-verify --allow-deprecation --unicode-char false --target go "%s" >> "%t" +// RUN: %run --no-verify --allow-deprecation --unicode-char false --target java "%s" >> "%t" // RUN: %diff "%s.expect" "%t" // Python salts hashes so they are not deterministic. diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1quiet/CompileRunQuietly.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1quiet/CompileRunQuietly.dfy index a811b377b8f..ce77443c7d5 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1quiet/CompileRunQuietly.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1quiet/CompileRunQuietly.dfy @@ -1,19 +1,19 @@ -// RUN: %build --unicode-char false --target cs "%s" > "%t" +// RUN: %build --allow-deprecation --unicode-char false --target cs "%s" > "%t" // RUN: dotnet %S/CompileRunQuietly.dll >> "%t" -// RUN: %build --unicode-char false --target js "%s" >> "%t" +// RUN: %build --allow-deprecation --unicode-char false --target js "%s" >> "%t" // RUN: node %S/CompileRunQuietly.js >> "%t" -// RUN: %build --unicode-char false --target go "%s" >> "%t" +// RUN: %build --allow-deprecation --unicode-char false --target go "%s" >> "%t" // RUN: %S/CompileRunQuietly >> "%t" -// RUN: %build --unicode-char false --target java "%s" >> "%t" +// RUN: %build --allow-deprecation --unicode-char false --target java "%s" >> "%t" // RUN: java -cp %binaryDir/DafnyRuntime.jar%{pathsep}%S/CompileRunQuietly.jar CompileRunQuietly >> "%t" -// RUN: %build --unicode-char false --target cpp "%s" >> "%t" +// RUN: %build --allow-deprecation --unicode-char false --target cpp "%s" >> "%t" // RUN: %S/CompileRunQuietly.exe >> "%t" -// RUN: %build --unicode-char false --target py "%s" >> "%t" +// RUN: %build --allow-deprecation --unicode-char false --target py "%s" >> "%t" // RUN: python3 %S/CompileRunQuietly-py >> "%t" // RUN: %diff "%s.expect" "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1verbose/CompileAndThenRun.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1verbose/CompileAndThenRun.dfy index 487d7b6ba73..134ba7d0456 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1verbose/CompileAndThenRun.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1verbose/CompileAndThenRun.dfy @@ -1,19 +1,19 @@ -// RUN: %build --unicode-char false --verbose --target cs "%s" > "%t" +// RUN: %build --verbose --target cs "%s" > "%t" // RUN: dotnet %S/CompileAndThenRun.dll >> "%t" -// RUN: %build --unicode-char false --verbose --target js "%s" >> "%t" +// RUN: %build --verbose --target js "%s" >> "%t" // RUN: node %S/CompileAndThenRun.js >> "%t" -// RUN: %build --unicode-char false --verbose --target go "%s" >> "%t" +// RUN: %build --verbose --target go "%s" >> "%t" // RUN: %S/CompileAndThenRun >> "%t" -// RUN: %build --unicode-char false --verbose --target java "%s" >> "%t" +// RUN: %build --verbose --target java "%s" >> "%t" // RUN: java -cp %binaryDir/DafnyRuntime.jar%{pathsep}%S/CompileAndThenRun.jar CompileAndThenRun >> "%t" -// RUN: %build --unicode-char false --verbose --target cpp "%s" >> "%t" +// RUN: %build --allow-deprecation --unicode-char false --verbose --target cpp "%s" >> "%t" // RUN: %S/CompileAndThenRun.exe >> "%t" -// RUN: %build --unicode-char false --verbose --target py "%s" >> "%t" +// RUN: %build --verbose --target py "%s" >> "%t" // RUN: python3 %S/CompileAndThenRun-py >> "%t" // RUN: %diff "%s.expect" "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile3/JustRun.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile3/JustRun.dfy index bbbfff8cb85..0dbb31608cc 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile3/JustRun.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile3/JustRun.dfy @@ -1,17 +1,17 @@ // NONUNIFORM: /compileVerbose:1 output is backend sensitive // (although the second set of comamnds could be separated out) -// RUN: %run --target cs --unicode-char false --verbose "%s" > "%t" -// RUN: %run --target js --unicode-char false --verbose "%s" >> "%t" -// RUN: %run --target go --unicode-char false --verbose "%s" >> "%t" -// RUN: %run --target java --unicode-char false --verbose "%s" >> "%t" -// RUN: %run --target cpp --unicode-char false --verbose "%s" >> "%t" -// RUN: %run --target py --unicode-char false --verbose "%s" >> "%t" -// RUN: %run --target cs --unicode-char false "%s" >> "%t" -// RUN: %run --target js --unicode-char false "%s" >> "%t" -// RUN: %run --target go --unicode-char false "%s" >> "%t" -// RUN: %run --target java --unicode-char false "%s" >> "%t" -// RUN: %run --target cpp --unicode-char false "%s" >> "%t" -// RUN: %run --target py --unicode-char false "%s" >> "%t" +// RUN: %run --target cs --verbose "%s" > "%t" +// RUN: %run --target js --verbose "%s" >> "%t" +// RUN: %run --target go --verbose "%s" >> "%t" +// RUN: %run --target java --verbose "%s" >> "%t" +// RUN: %run --target cpp --allow-deprecation --unicode-char false --verbose "%s" >> "%t" +// RUN: %run --target py --verbose "%s" >> "%t" +// RUN: %run --target cs "%s" >> "%t" +// RUN: %run --target js "%s" >> "%t" +// RUN: %run --target go "%s" >> "%t" +// RUN: %run --target java "%s" >> "%t" +// RUN: %run --target cpp --allow-deprecation --unicode-char false "%s" >> "%t" +// RUN: %run --target py "%s" >> "%t" // RUN: %diff "%s.expect" "%t" method Main() { diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/doofiles/standardLibraryOptionMismatch.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/doofiles/standardLibraryOptionMismatch.dfy index 926598b0657..c71e32b77bd 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/doofiles/standardLibraryOptionMismatch.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/doofiles/standardLibraryOptionMismatch.dfy @@ -1,4 +1,4 @@ -// RUN: %translate cs --unicode-char false --standard-libraries true %s &> "%t" +// RUN: %translate cs --allow-deprecation --unicode-char false --standard-libraries true %s &> "%t" // RUN: %diff "%s.expect" "%t" method Foo() { diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/examples/Simple_compiler/Compiler.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/examples/Simple_compiler/Compiler.dfy index 207f037f111..8054340133a 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/examples/Simple_compiler/Compiler.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/examples/Simple_compiler/Compiler.dfy @@ -1,5 +1,5 @@ // RUN: cp %S/Simple.g4 %S/csharp/Simple.g4 -// RUN: %translate cs --include-runtime --unicode-char false --output:%S/csharp/Compiler.cs "%s" +// RUN: %translate cs --include-runtime --allow-deprecation --unicode-char false --output:%S/csharp/Compiler.cs "%s" // RUN: dotnet run --project %S/csharp/SimpleCompiler.csproj -- %S/example_input.calc > "%t" // RUN: %diff "%s.expect" "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectAndExceptions.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectAndExceptions.dfy index bd20d9f5032..8a356da3c22 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectAndExceptions.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectAndExceptions.dfy @@ -1,7 +1,7 @@ -// RUN: ! %run --target cs --unicode-char false "%s" > "%t" -// RUN: ! %run --target go --unicode-char false "%s" >> "%t" -// RUN: ! %run --target java --unicode-char false "%s" >> "%t" -// RUN: ! %run --target js --unicode-char false "%s" >> "%t" +// RUN: ! %run --target cs "%s" > "%t" +// RUN: ! %run --target go "%s" >> "%t" +// RUN: ! %run --target java "%s" >> "%t" +// RUN: ! %run --target js "%s" >> "%t" // RUN: %diff "%s.expect" "%t" include "../exceptions/NatOutcomeDt.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectAndExceptions.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectAndExceptions.dfy.expect index 637e7a65f5a..572284717d0 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectAndExceptions.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectAndExceptions.dfy.expect @@ -1,12 +1,12 @@ Dafny program verifier finished with 2 verified, 0 errors -[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure(Kaboom!) +[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") Dafny program verifier finished with 2 verified, 0 errors -[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure(Kaboom!) +[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") Dafny program verifier finished with 2 verified, 0 errors -[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure(Kaboom!) +[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") Dafny program verifier finished with 2 verified, 0 errors -[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure(Kaboom!) +[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithNonStringMessage.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithNonStringMessage.dfy index cb01702e505..a3cf3f845f4 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithNonStringMessage.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithNonStringMessage.dfy @@ -1,9 +1,9 @@ -// RUN: %verify --unicode-char false "%s" > "%t" -// RUN: ! %run --no-verify --unicode-char false --target cs "%s" >> "%t" -// RUN: ! %run --no-verify --unicode-char false --target go "%s" >> "%t" -// RUN: ! %run --no-verify --unicode-char false --target java "%s" >> "%t" -// RUN: ! %run --no-verify --unicode-char false --target js "%s" >> "%t" -// RUN: ! %run --no-verify --unicode-char false --target py "%s" >> "%t" +// RUN: %verify "%s" > "%t" +// RUN: ! %run --no-verify --target cs "%s" >> "%t" +// RUN: ! %run --no-verify --target go "%s" >> "%t" +// RUN: ! %run --no-verify --target java "%s" >> "%t" +// RUN: ! %run --no-verify --target js "%s" >> "%t" +// RUN: ! %run --no-verify --target py "%s" >> "%t" // RUN: %diff "%s.expect" "%t" datatype Option = None | Some(get: T) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithNonStringMessage.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithNonStringMessage.dfy.expect index 61a08ba76bd..f33401eab87 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithNonStringMessage.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithNonStringMessage.dfy.expect @@ -2,16 +2,16 @@ Dafny program verifier finished with 0 verified, 0 errors Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(where over the rainbow) +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(where over the rainbow) +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(where over the rainbow) +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(where over the rainbow) +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(where over the rainbow) +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1151-more.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1151-more.dfy index b8d81ad96d2..1199be41d82 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1151-more.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1151-more.dfy @@ -1,10 +1,10 @@ -// RUN: %verify --relax-definite-assignment --unicode-char false "%s" > "%t" -// RUN: %exits-with 3 %run --no-verify --unicode-char false --target cs "%s" >> "%t" -// RUN: %exits-with 3 %run --no-verify --unicode-char false --target java "%s" >> "%t" -// RUN: %exits-with 3 %run --no-verify --unicode-char false --target js "%s" >> "%t" -// RUN: %exits-with 3 %run --no-verify --unicode-char false --target go "%s" >> "%t" -// RUN: %exits-with 3 %run --no-verify --unicode-char false --target cpp "%s" >> "%t" -// RUN: %exits-with 3 %run --no-verify --unicode-char false --target py "%s" >> "%t" +// RUN: %verify --relax-definite-assignment "%s" > "%t" +// RUN: %exits-with 3 %run --no-verify --target cs "%s" >> "%t" +// RUN: %exits-with 3 %run --no-verify --target java "%s" >> "%t" +// RUN: %exits-with 3 %run --no-verify --target js "%s" >> "%t" +// RUN: %exits-with 3 %run --no-verify --target go "%s" >> "%t" +// RUN: %exits-with 3 %run --no-verify --allow-deprecation --unicode-char false --target cpp "%s" >> "%t" +// RUN: %exits-with 3 %run --no-verify --target py "%s" >> "%t" // RUN: %diff "%s.expect" "%t" // The following example should produce a compilation error, since there's diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-356-errors.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-356-errors.dfy index ad136a2dd2c..ad1153a3e41 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-356-errors.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-356-errors.dfy @@ -1,4 +1,4 @@ -// RUN: %exits-with 4 %verify --unicode-char false "%s" > "%t" +// RUN: %exits-with 4 %verify "%s" > "%t" // RUN: %diff "%s.expect" "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/wishlist/GoModule.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/wishlist/GoModule.dfy index 8e69cdf6c56..d6a141edb86 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/wishlist/GoModule.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/wishlist/GoModule.dfy @@ -1,5 +1,5 @@ // NONUNIFORM: Go-specific extern test -// RUN: %exits-with 3 %run --unicode-char false --target go "%s" &> "%t" +// RUN: %exits-with 3 %run --target go "%s" &> "%t" // RUN: %OutputCheck --file-to-check "%t" "%s" // CHECK: undefined: GoModuleConversions.ParseURL From fd3a1b9bc0f10d756831aac0084e6b66ceeb671e Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Mon, 8 Apr 2024 13:40:52 +0200 Subject: [PATCH 06/26] Changes --- .../src/Std/Unicode/UnicodeStrings.dfy | 2 +- .../RunAllTests/RunAllTestsOption.dfy | 10 +- .../RunAllTests/RunAllTestsOption.dfy.expect | 36 +++---- ...rationNoInliningEnumerativeDefinitions.dfy | 4 +- ...ationWithInliningQuantifiedDefinitions.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/arrays.dfy | 2 +- .../LitTests/LitTest/c++/bit-vectors.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/class.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/const.dfy | 2 +- .../LitTests/LitTest/c++/datatypes.dfy | 2 +- .../LitTests/LitTest/c++/generic.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/hello.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/ints.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/maps.dfy | 2 +- .../LitTests/LitTest/c++/recursion.dfy | 2 +- .../LitTests/LitTest/c++/returns.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/seqs.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/sets.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/while.dfy | 2 +- .../LitTests/LitTest/comp/Arrays.dfy | 3 +- .../LitTests/LitTest/comp/Arrays.dfy.expect | 30 +++--- .../LitTests/LitTest/comp/Collections.dfy | 2 +- .../LitTest/comp/Collections.dfy.expect | 4 +- .../LitTest/comp/Collections.dfy.go.expect | 4 +- .../LitTest/comp/Collections.dfy.java.expect | 4 +- .../LitTest/comp/Collections.dfy.js.expect | 4 +- .../LitTest/comp/Collections.dfy.py.expect | 4 +- .../LitTest/comp/CompileWithArguments.dfy | 4 +- .../comp/CompileWithArguments.dfy.expect | 6 -- .../LitTests/LitTest/comp/Comprehensions.dfy | 2 +- .../LitTest/comp/ErasableTypeWrappers.dfy | 2 +- .../LitTests/LitTest/comp/NativeNumbers.dfy | 2 +- .../LitTest/comp/NativeNumbers.dfy.expect | 2 +- .../LitTests/LitTest/comp/Numbers.dfy | 2 +- .../LitTests/LitTest/comp/Numbers.dfy.expect | 10 +- .../LitTest/comp/Numbers.dfy.go.expect | 10 +- .../LitTest/comp/Numbers.dfy.py.expect | 10 +- .../LitTest/contract-wrappers/AllExterns.dfy | 2 +- .../dafny0/ArrayElementInitCompile.dfy | 2 +- .../LitTests/LitTest/dafny0/Char.dfy.expect | 5 +- .../LitTest/expectations/Expect.dfy.expect | 10 +- .../ExpectAndExceptions.dfy.expect | 11 ++- .../expectations/ExpectWithMessage.dfy.expect | 3 + .../ExpectWithNonStringMessage.dfy.expect | 10 +- .../LitTest/git-issues/git-issue-1100.dfy | 2 +- .../LitTest/git-issues/git-issue-258.dfy | 2 +- .../LitTest/git-issues/git-issue-2733.dfy | 2 +- .../LitTest/git-issues/git-issue-356.dfy | 2 +- .../LitTest/git-issues/git-issue-3571.dfy | 2 +- .../LitTest/git-issues/github-issue-2928.dfy | 19 +--- .../LitTest/git-issues/github-issue-2989.dfy | 2 +- .../LitTest/separate-verification/app.dfy | 2 +- .../stdlibs/StandardLibraries_Errors.dfy | 2 +- .../DafnyTests/RunAllTestsOption.dfy | 12 +-- .../DafnyTests/RunAllTestsOption.dfy.expect | 36 ++++--- .../LitTest/unicodechars/comp/Arrays.dfy | 3 +- .../unicodechars/comp/Arrays.dfy.expect | 33 ++++--- .../unicodechars/comp/Arrays.dfy.expect2 | 96 +++++++++++++++++++ .../comp/Arrays.dfy.go.expect | 3 + .../LitTest/unicodechars/comp/Collections.dfy | 2 +- .../unicodechars/comp/Collections.dfy.expect | 4 +- .../comp/Collections.dfy.go.expect | 4 +- .../comp/Collections.dfy.java.expect | 4 +- .../comp/Collections.dfy.js.expect | 4 +- .../comp/Collections.dfy.py.expect | 4 +- .../comp/CompileWithArguments.dfy | 20 ++-- .../comp/CompileWithArguments.dfy.expect | 6 ++ .../unicodechars/comp/ExternDafnyString.dfy | 2 +- .../unicodechars/comp/ExternJavaString.dfy | 2 +- .../comp/NativeNumbers.dfy.expect | 2 +- .../unicodechars/comp/Numbers.dfy.expect | 10 +- .../unicodechars/comp/Numbers.dfy.go.expect | 10 +- .../unicodechars/comp/Numbers.dfy.py.expect | 10 +- .../unicodechars/dafny0/Char.dfy.expect | 5 +- .../unicodechars/expectations/Expect.dfy | 10 +- .../expectations/Expect.dfy.expect | 10 +- .../ExpectAndExceptions.dfy.expect | 11 +-- .../expectations/ExpectWithMessage.dfy.expect | 3 - .../ExpectWithNonStringMessage.dfy.expect | 10 +- Source/TestDafny/MultiBackendTest.cs | 50 +++++++++- 80 files changed, 381 insertions(+), 250 deletions(-) create mode 100644 Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.expect2 rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{ => unicodechars}/comp/Arrays.dfy.go.expect (94%) diff --git a/Source/DafnyStandardLibraries/src/Std/Unicode/UnicodeStrings.dfy b/Source/DafnyStandardLibraries/src/Std/Unicode/UnicodeStrings.dfy index 584dd68cd59..510cd597145 100644 --- a/Source/DafnyStandardLibraries/src/Std/Unicode/UnicodeStrings.dfy +++ b/Source/DafnyStandardLibraries/src/Std/Unicode/UnicodeStrings.dfy @@ -13,7 +13,7 @@ * of the `char` type and hence the `string` type, * this module must be implemented differently for each option value. * Currently, the only available implementation is for `--unicode-char:true`, - * and the implementation for `--unicode-char:false` is upcoming. + * and the implementation for `--unicode-char false` is upcoming. * * If you also want to maintain code that works for either `--unicode-char` value, * implement your logic in an abstract module that imports this one. diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy index bfe93c65475..46140cf90cd 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy @@ -1,11 +1,11 @@ // RUN: %verify "%s" > "%t" // RUN: %translate cs %args %s --include-runtime --include-test-runner --allow-deprecation --unicode-char false --no-verify --output %S/Output/manual/program.cs >> "%t" // RUN: ! dotnet run -v q --property WarningLevel=0 --project %S/RunAllTests.csproj >> "%t" -// RUN: ! %baredafny test %args --allow-deprecation --unicode-char:false --no-verify --target:cs "%s" >> "%t" -// RUN: ! %baredafny test %args --allow-deprecation --unicode-char:false --no-verify --target:java "%s" >> "%t" -// RUN: ! %baredafny test %args --allow-deprecation --unicode-char:false --no-verify --target:go "%s" >> "%t" -// RUN: ! %baredafny test %args --allow-deprecation --unicode-char:false --no-verify --target:js "%s" >> "%t" -// RUN: ! %baredafny test %args --allow-deprecation --unicode-char:false --no-verify --target:py "%s" >> "%t" +// RUN: ! %baredafny test %args --allow-deprecation --unicode-char false --no-verify --target:cs "%s" >> "%t" +// RUN: ! %baredafny test %args --allow-deprecation --unicode-char false --no-verify --target:java "%s" >> "%t" +// RUN: ! %baredafny test %args --allow-deprecation --unicode-char false --no-verify --target:go "%s" >> "%t" +// RUN: ! %baredafny test %args --allow-deprecation --unicode-char false --no-verify --target:js "%s" >> "%t" +// RUN: ! %baredafny test %args --allow-deprecation --unicode-char false --no-verify --target:py "%s" >> "%t" // RUN: %diff "%s.expect" "%t" include "../../exceptions/VoidOutcomeDt.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy.expect index 8a79d694bda..5757b59045c 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy.expect @@ -1,5 +1,5 @@ -Dafny program verifier finished with 1 verified, 0 errors +Dafny program verifier finished with 2 verified, 0 errors Dafny program verifier did not attempt verification TestModule.Passing1: PASSED @@ -11,8 +11,8 @@ Passing3: PASSED Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED - VoidOutcome.VoidFailure(Whoopsie) -[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. + VoidOutcome.VoidFailure("Whoopsie") +[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. Dafny program verifier did not attempt verification @@ -25,8 +25,8 @@ Passing3: PASSED Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED - VoidOutcome.VoidFailure(Whoopsie) -[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. + VoidOutcome.VoidFailure("Whoopsie") +[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. Dafny program verifier did not attempt verification @@ -39,8 +39,8 @@ Passing3: PASSED Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED - VoidOutcome.VoidFailure(Whoopsie) -[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. + VoidOutcome.VoidFailure("Whoopsie") +[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. Dafny program verifier did not attempt verification @@ -53,8 +53,8 @@ Passing3: PASSED Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED - VoidOutcome.VoidFailure(Whoopsie) -[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. + VoidOutcome.VoidFailure("Whoopsie") +[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. Dafny program verifier did not attempt verification @@ -67,20 +67,6 @@ Passing3: PASSED Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED - VoidOutcome.VoidFailure(Whoopsie) -[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. - - -Dafny program verifier did not attempt verification -TestModule.Passing1: PASSED -Passing1: PASSED -Passing2: PASSED -Failing1: FAILED - RunAllTestsOption.dfy(23,2): expectation violation -Passing3: PASSED -Failing2: FAILED - RunAllTestsOption.dfy(31,2): expectation violation -FailingReturnValue: FAILED - VoidOutcome.VoidFailure(Whoopsie) -[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. + VoidOutcome.VoidFailure("Whoopsie") +[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationNoInliningEnumerativeDefinitions.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationNoInliningEnumerativeDefinitions.dfy index fdd509d814d..819f3a24956 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationNoInliningEnumerativeDefinitions.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationNoInliningEnumerativeDefinitions.dfy @@ -1,11 +1,11 @@ // Generating and Running Block-Based Tests: // RUN: %baredafny generate-tests %args Block %S/TestGenerationNoInliningEnumerativeDefinitions.dfy > %t-tests.dfy -// RUN: %baredafny test %args --allow-deprecation --unicode-char:false --target:cs "%t-tests.dfy" >> "%t" +// RUN: %baredafny test %args --allow-deprecation --unicode-char false --target:cs "%t-tests.dfy" >> "%t" // Generating and Running Path-Based Tests: // RUN: %baredafny generate-tests %args Path %S/TestGenerationNoInliningEnumerativeDefinitions.dfy > %t-tests.dfy -// RUN: %baredafny test %args --allow-deprecation --unicode-char:false --target:cs "%t-tests.dfy" >> "%t" +// RUN: %baredafny test %args --allow-deprecation --unicode-char false --target:cs "%t-tests.dfy" >> "%t" // RUN: %OutputCheck --file-to-check "%t" "%s" // CHECK: .*Dafny program verifier finished with 2 verified, 0 errors* diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationWithInliningQuantifiedDefinitions.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationWithInliningQuantifiedDefinitions.dfy index 963c7e7f95c..ce17619f9e1 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationWithInliningQuantifiedDefinitions.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationWithInliningQuantifiedDefinitions.dfy @@ -1,6 +1,6 @@ // Generating and Running Path-Based Tests: // RUN: %baredafny generate-tests %args Path %S/TestGenerationWithInliningQuantifiedDefinitions.dfy > %t-tests.dfy -// RUN: %baredafny test %args --allow-deprecation --unicode-char:false --target:cs "%t-tests.dfy" >> "%t" +// RUN: %baredafny test %args --allow-deprecation --unicode-char false --target:cs "%t-tests.dfy" >> "%t" // RUN: %OutputCheck --file-to-check "%t" "%s" // CHECK: .*Dafny program verifier finished with 5 verified, 0 errors* diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/arrays.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/arrays.dfy index c35460efc6f..75a5dc401c6 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/arrays.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/arrays.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char false newtype uint32 = i:int | 0 <= i < 0x100000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/bit-vectors.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/bit-vectors.dfy index 701cf1c99c5..8d69b732959 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/bit-vectors.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/bit-vectors.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false newtype uint64 = i:int | 0 <= i < 0x10000000000000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/class.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/class.dfy index 5aefab47194..f188b70fa16 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/class.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/class.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false newtype uint32 = i:int | 0 <= i < 0x100000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/const.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/const.dfy index 3ca8fb1c46e..48603f6652c 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/const.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/const.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false module Holder { const x:bool := false diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/datatypes.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/datatypes.dfy index 89d373f23cb..0d156ceb301 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/datatypes.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/datatypes.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false newtype uint32 = i:int | 0 <= i < 0x100000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/generic.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/generic.dfy index 7adc6be08e7..bb8b48dd5f4 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/generic.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/generic.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false class Test { var t:T diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/hello.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/hello.dfy index 7f6cf623425..8dcc04d4201 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/hello.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/hello.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false method Main() { print "Hello world\n"; diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/ints.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/ints.dfy index 7e4a5a0360d..4a7a9d99c9b 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/ints.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/ints.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false newtype sbyte = i:int | -0x80 <= i < 0x80 newtype byte = i:int | 0 <= i < 0x100 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/maps.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/maps.dfy index 2d32b1808c3..c4547f3c6e4 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/maps.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/maps.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false newtype uint32 = i:int | 0 <= i < 0x100000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/recursion.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/recursion.dfy index 34f9c2a4b12..c26e140f636 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/recursion.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/recursion.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false newtype uint32 = i:int | 0 <= i < 0x100000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/returns.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/returns.dfy index a613b0d934f..f6bde37f163 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/returns.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/returns.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false newtype uint64 = i:int | 0 <= i < 0x10000000000000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/seqs.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/seqs.dfy index 1dbd6998367..717217bd65b 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/seqs.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/seqs.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false newtype uint8 = i:int | 0 <= i < 0x100 newtype uint32 = i:int | 0 <= i < 0x100000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/sets.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/sets.dfy index c72b1b0f31f..870f83ce329 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/sets.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/sets.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false newtype uint32 = i:int | 0 <= i < 0x100000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/while.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/while.dfy index 5fbec60660b..33a5b36db95 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/while.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/while.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false newtype uint32 = i:int | 0 <= i < 0x100000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Arrays.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Arrays.dfy index d062529db1b..96d98159d23 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Arrays.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Arrays.dfy @@ -1,5 +1,4 @@ -// NONUNIFORM: https://github.com/dafny-lang/dafny/issues/2582 -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment method LinearSearch(a: array, key: int) returns (n: nat) ensures 0 <= n <= a.Length diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Arrays.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Arrays.dfy.expect index ef3b884f98a..4511b0842c8 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Arrays.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Arrays.dfy.expect @@ -5,8 +5,8 @@ [20, 21, 22] [0, 1, 2, 3, 4, 5, 6, 7] [0, 1, 2, 3, 4, 5, 6, 7] -d d d -h e l l o +'d' 'd' 'd' +'h' 'e' 'l' 'l' 'o' 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 @@ -18,34 +18,34 @@ It's null hi hello tjena hej hola hi hello tjena hej hola hi hello tjena hej hola -d d d -h e l l o +'d' 'd' 'd' +'h' 'e' 'l' 'l' 'o' 8 8 8 8 true true true 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 -(d, 8, true, 1, 2, 3, 4) -D D D +('d', 8, true, 1, 2, 3, 4) +'D' 'D' 'D' 0 0 0 0 false false false 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -(D, 0, false, 0, 0, 0, 0) +('D', 0, false, 0, 0, 0, 0) 8 0 false 0 null null 8 8 8 8 8 8 8 8 -D D D -D D D -D D D -D D r (D, D, r) -D D r +'D' 'D' 'D' +'D' 'D' 'D' +'D' 'D' 'D' +'D' 'D' 'r' ('D', 'D', 'r') +'D' 'D' 'r' [19, 18, 9, 8] true false @@ -81,14 +81,14 @@ hello [0, 1, 2, 3, 4] [2, 2, 2, 2, 2] [0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 20, 21, 22, 23, 24, 60, 60, 60, 60, 60] [0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 20, 21, 22, 23, 24, 60, 60, 60, 60, 60] DDDDDabcdeabcdeggggg -DDDDDabcdeabcdeggggg +['D', 'D', 'D', 'D', 'D', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'g', 'g', 'g', 'g', 'g'] [77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 50, 78, 78, 78, 78, 78, 50, 78, 78, 78] [77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 50, 78, 78, 78, 78, 78, 50, 78, 78, 78] [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 60, 60, 60, 60, 60, 50, 60, 60, 60] -DDDDDDDDDDagggggaggg +['D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'a', 'g', 'g', 'g', 'g', 'g', 'a', 'g', 'g', 'g'] 0 69 50 0 69 50 -D k n +'D' 'k' 'n' false false true true false false diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy index 0a27b36b64e..79b6f16b4a9 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy @@ -1,5 +1,5 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4108 -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation method Main() { Sets(); diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.expect index 7c0fbb1b828..a896b0d701f 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.expect @@ -12,7 +12,7 @@ Sets: {} {17, 82} {12, 17} eq covariance: 1 true true false true |s|=4 |S|=16 -{{}, {a}, {b}, {c}, {d}, {a, b}, {a, c}, {b, c}, {a, d}, {b, d}, {c, d}, {a, b, c}, {a, b, d}, {a, c, d}, {b, c, d}, {a, b, c, d}} +{{}, {'a'}, {'b'}, {'c'}, {'d'}, {'a', 'b'}, {'a', 'c'}, {'b', 'c'}, {'a', 'd'}, {'b', 'd'}, {'c', 'd'}, {'a', 'b', 'c'}, {'a', 'b', 'd'}, {'a', 'c', 'd'}, {'b', 'c', 'd'}, {'a', 'b', 'c', 'd'}} Multisets: multiset{} multiset{17, 17, 82, 82} multiset{12, 17} cardinality: 0 4 2 union: multiset{17, 17, 82, 82} multiset{12, 17, 17, 17, 82, 82} @@ -48,7 +48,7 @@ Sequences: [] [17, 82, 17, 82] [12, 17] membership: false true true Bound Bound Bound Bound Bound Bound ed ed ed ed ed ed -e e e e e e +'e' 'e' 'e' 'e' 'e' 'e' hello hEllo [2, 4, 6, 8, 10] diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.go.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.go.expect index 19be6351e0d..7c5ae68b60f 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.go.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.go.expect @@ -12,7 +12,7 @@ Sets: {} {17, 82} {12, 17} eq covariance: 1 true true false true |s|=4 |S|=16 -{{}, {a}, {b}, {c}, {d}, {a, b}, {a, c}, {b, c}, {a, d}, {b, d}, {c, d}, {a, b, c}, {a, b, d}, {a, c, d}, {b, c, d}, {a, b, c, d}} +{{}, {'a'}, {'b'}, {'c'}, {'d'}, {'a', 'b'}, {'a', 'c'}, {'b', 'c'}, {'a', 'd'}, {'b', 'd'}, {'c', 'd'}, {'a', 'b', 'c'}, {'a', 'b', 'd'}, {'a', 'c', 'd'}, {'b', 'c', 'd'}, {'a', 'b', 'c', 'd'}} Multisets: multiset{} multiset{17, 17, 82, 82} multiset{12, 17} cardinality: 0 4 2 union: multiset{17, 17, 82, 82} multiset{17, 17, 17, 82, 82, 12} @@ -48,7 +48,7 @@ Sequences: [] [17, 82, 17, 82] [12, 17] membership: false true true Bound Bound Bound Bound Bound Bound ed ed ed ed ed ed -e e e e e e +'e' 'e' 'e' 'e' 'e' 'e' hello hEllo [2, 4, 6, 8, 10] diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.java.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.java.expect index 60f096fe133..7b9a3bf1e51 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.java.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.java.expect @@ -12,7 +12,7 @@ Sets: {} {17, 82} {17, 12} eq covariance: 1 true true false true |s|=4 |S|=16 -{{}, {a}, {b}, {c}, {d}, {a, b}, {a, c}, {b, c}, {a, d}, {b, d}, {c, d}, {a, b, c}, {a, b, d}, {a, c, d}, {b, c, d}, {a, b, c, d}} +{{}, {'a'}, {'b'}, {'c'}, {'d'}, {'a', 'b'}, {'a', 'c'}, {'b', 'c'}, {'a', 'd'}, {'b', 'd'}, {'c', 'd'}, {'a', 'b', 'c'}, {'a', 'b', 'd'}, {'a', 'c', 'd'}, {'b', 'c', 'd'}, {'a', 'b', 'c', 'd'}} Multisets: multiset{} multiset{17, 17, 82, 82} multiset{17, 12} cardinality: 0 4 2 union: multiset{17, 17, 82, 82} multiset{17, 17, 17, 82, 82, 12} @@ -48,7 +48,7 @@ Sequences: [] [17, 82, 17, 82] [12, 17] membership: false true true Bound Bound Bound Bound Bound Bound ed ed ed ed ed ed -e e e e e e +'e' 'e' 'e' 'e' 'e' 'e' hello hEllo [2, 4, 6, 8, 10] diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.js.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.js.expect index 19be6351e0d..7c5ae68b60f 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.js.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.js.expect @@ -12,7 +12,7 @@ Sets: {} {17, 82} {12, 17} eq covariance: 1 true true false true |s|=4 |S|=16 -{{}, {a}, {b}, {c}, {d}, {a, b}, {a, c}, {b, c}, {a, d}, {b, d}, {c, d}, {a, b, c}, {a, b, d}, {a, c, d}, {b, c, d}, {a, b, c, d}} +{{}, {'a'}, {'b'}, {'c'}, {'d'}, {'a', 'b'}, {'a', 'c'}, {'b', 'c'}, {'a', 'd'}, {'b', 'd'}, {'c', 'd'}, {'a', 'b', 'c'}, {'a', 'b', 'd'}, {'a', 'c', 'd'}, {'b', 'c', 'd'}, {'a', 'b', 'c', 'd'}} Multisets: multiset{} multiset{17, 17, 82, 82} multiset{12, 17} cardinality: 0 4 2 union: multiset{17, 17, 82, 82} multiset{17, 17, 17, 82, 82, 12} @@ -48,7 +48,7 @@ Sequences: [] [17, 82, 17, 82] [12, 17] membership: false true true Bound Bound Bound Bound Bound Bound ed ed ed ed ed ed -e e e e e e +'e' 'e' 'e' 'e' 'e' 'e' hello hEllo [2, 4, 6, 8, 10] diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.py.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.py.expect index a8cb6f4eb53..b68ff60874b 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.py.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Collections.dfy.py.expect @@ -12,7 +12,7 @@ Sets: {} {17, 82} {17, 12} eq covariance: 1 true true false true |s|=4 |S|=16 -{{}, {a}, {b}, {c}, {d}, {a, b}, {a, c}, {b, c}, {a, d}, {b, d}, {c, d}, {a, b, c}, {a, b, d}, {a, c, d}, {b, c, d}, {a, b, c, d}} +{{}, {'a'}, {'b'}, {'c'}, {'d'}, {'a', 'b'}, {'a', 'c'}, {'b', 'c'}, {'a', 'd'}, {'b', 'd'}, {'c', 'd'}, {'a', 'b', 'c'}, {'a', 'b', 'd'}, {'a', 'c', 'd'}, {'b', 'c', 'd'}, {'a', 'b', 'c', 'd'}} Multisets: multiset{} multiset{17, 17, 82, 82} multiset{12, 17} cardinality: 0 4 2 union: multiset{17, 17, 82, 82} multiset{17, 17, 17, 82, 82, 12} @@ -48,7 +48,7 @@ Sequences: [] [17, 82, 17, 82] [12, 17] membership: false true true Bound Bound Bound Bound Bound Bound ed ed ed ed ed ed -e e e e e e +'e' 'e' 'e' 'e' 'e' 'e' hello hEllo [2, 4, 6, 8, 10] diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArguments.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArguments.dfy index 2a808d7795e..d5a6fd29ab0 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArguments.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArguments.dfy @@ -1,7 +1,7 @@ // NONUNIFORM: Multiple testing scenarios, highly backend sensitive, testing CLI // RUN: %verify "%s" > "%t" // RUN: %run --no-verify --target:cs "%s" Csharp 1 >> "%t" -// RUN: %run --no-verify --target:cpp --allow-deprecation --unicode-char:false "%s" Cpp Yipee >> "%t" +// RUN: %run --no-verify --target:cpp --allow-deprecation --unicode-char false "%s" Cpp Yipee >> "%t" // RUN: %run --no-verify --target:java "%s" -- Java --heya >> "%t" // RUN: %run --no-verify --target:js "%s" -- Javascript 2 >> "%t" // RUN: %run --no-verify --target py "%s" Python 1 >> "%t" @@ -14,7 +14,7 @@ // RUN: node %s.js "javascript" 2 >> "%t" // RUN: node %s.js "javascript" 1 >> "%t" // RUN: node %s.js "javascript" "aloha" >> "%t" -// RUN: %build --no-verify --target:cpp --allow-deprecation --unicode-char:false "%s" --output=%s.exe +// RUN: %build --no-verify --target:cpp --allow-deprecation --unicode-char false "%s" --output=%s.exe // RUN: %s.exe "cpp" 2 >> "%t" // RUN: %s.exe "cpp" 1 >> "%t" // RUN: %s.exe "cpp" "aloha" >> "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArguments.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArguments.dfy.expect index b5ed55540d8..f063b7c22c2 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArguments.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArguments.dfy.expect @@ -4,9 +4,6 @@ Dafny program verifier finished with 1 verified, 0 errors Dafny program verifier did not attempt verification Csharp says hello -Dafny program verifier did not attempt verification -Cpp says Yipee - Dafny program verifier did not attempt verification Java says --heya @@ -24,9 +21,6 @@ dotnet says aloha javascript says howdy javascript says hello javascript says aloha -cpp says howdy -cpp says hello -cpp says aloha Dafny program verifier did not attempt verification Java says howdy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Comprehensions.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Comprehensions.dfy index dcbca9e37cb..e463c792200 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Comprehensions.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Comprehensions.dfy @@ -1,5 +1,5 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4108 -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false method Main() { AssignSuchThat(); diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy index 6fe56c10bc1..fc5f494d48f 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false --type-system-refresh --general-traits=datatype +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false --type-system-refresh --general-traits=datatype datatype SingletonRecord = SingletonRecord(u: int) datatype GhostOrNot = ghost Ghost(a: int, b: int) | Compiled(x: int) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/NativeNumbers.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/NativeNumbers.dfy index 2c98a98ff04..8781c62c159 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/NativeNumbers.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/NativeNumbers.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false // Skip JavaScript because JavaScript doesn't have the same native types diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/NativeNumbers.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/NativeNumbers.dfy.expect index 6a9d263fc73..354d931a151 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/NativeNumbers.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/NativeNumbers.dfy.expect @@ -28,7 +28,7 @@ Cast from cardinality operator: 4 4 4 4 4 4 4 4 4 Characters: -C 67 67 67 67 67 67 67 67 67 +'C' 67 67 67 67 67 67 67 67 67 0 127 32767 65535 65535 255 65535 65535 65535 Defaults: diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy index e7f31ea0723..9743fe543e3 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy @@ -1,5 +1,5 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4174 -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char false method Main() { Literals(); diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy.expect index bd45e868fd6..4c6cf5c8a91 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy.expect @@ -33,7 +33,7 @@ 35 27 -27 124 -124 -124 124 -g Q 2 +'g' 'Q' '2' 7 3 31 -8 1 -31 -7 3 31 @@ -98,11 +98,11 @@ NativeType: 0 <0 N <=0 Y ==0 Y !=0 N >0 N >=0 Y 0< N 0<= Y 0== Y 0!= N 0> N 0>= Y 0 <0 N <=0 Y ==0 Y !=0 N >0 N >=0 Y 0< N 0<= Y 0== Y 0!= N 0> N 0>= Y 23 <0 N <=0 N ==0 N !=0 Y >0 Y >=0 Y 0< Y 0<= Y 0== N 0!= Y 0> N 0>= N -120 120.0 120 120 120 x -120 120.0 120 120 120 x +120 120.0 120 120 120 'x' +120 120.0 120 120 120 'x' 120 120 -120 120.0 120 120 120 x -120 120.0 120 120 120 x +120 120.0 120 120 120 'x' +120 120.0 120 120 120 'x' 120 120 false true false true true false true false diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy.go.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy.go.expect index 8249aa59ada..43212d1a81e 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy.go.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy.go.expect @@ -33,7 +33,7 @@ 35 27 -27 124 -124 -124 124 -g Q 2 +'g' 'Q' '2' 7 3 31 -8 1 -31 -7 3 31 @@ -98,11 +98,11 @@ NativeType: 0 <0 N <=0 Y ==0 Y !=0 N >0 N >=0 Y 0< N 0<= Y 0== Y 0!= N 0> N 0>= Y 0 <0 N <=0 Y ==0 Y !=0 N >0 N >=0 Y 0< N 0<= Y 0== Y 0!= N 0> N 0>= Y 23 <0 N <=0 N ==0 N !=0 Y >0 Y >=0 Y 0< Y 0<= Y 0== N 0!= Y 0> N 0>= N -120 120.0 120 120 120 x -120 120.0 120 120 120 x +120 120.0 120 120 120 'x' +120 120.0 120 120 120 'x' 120 120 -120 120.0 120 120 120 x -120 120.0 120 120 120 x +120 120.0 120 120 120 'x' +120 120.0 120 120 120 'x' 120 120 false true false true true false true false diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy.py.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy.py.expect index 8249aa59ada..43212d1a81e 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy.py.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy.py.expect @@ -33,7 +33,7 @@ 35 27 -27 124 -124 -124 124 -g Q 2 +'g' 'Q' '2' 7 3 31 -8 1 -31 -7 3 31 @@ -98,11 +98,11 @@ NativeType: 0 <0 N <=0 Y ==0 Y !=0 N >0 N >=0 Y 0< N 0<= Y 0== Y 0!= N 0> N 0>= Y 0 <0 N <=0 Y ==0 Y !=0 N >0 N >=0 Y 0< N 0<= Y 0== Y 0!= N 0> N 0>= Y 23 <0 N <=0 N ==0 N !=0 Y >0 Y >=0 Y 0< Y 0<= Y 0== N 0!= Y 0> N 0>= N -120 120.0 120 120 120 x -120 120.0 120 120 120 x +120 120.0 120 120 120 'x' +120 120.0 120 120 120 'x' 120 120 -120 120.0 120 120 120 x -120 120.0 120 120 120 x +120 120.0 120 120 120 'x' +120 120.0 120 120 120 'x' 120 120 false true false true true false true false diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/contract-wrappers/AllExterns.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/contract-wrappers/AllExterns.dfy index a269eb67e5d..44010b3adc2 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/contract-wrappers/AllExterns.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/contract-wrappers/AllExterns.dfy @@ -1,4 +1,4 @@ -// RUN: ! %baredafny test %args --allow-deprecation --unicode-char:false --allow-warnings --test-assumptions=externs %s %s.externs.cs > %t +// RUN: ! %baredafny test %args --allow-deprecation --unicode-char false --allow-warnings --test-assumptions=externs %s %s.externs.cs > %t // RUN: %diff "%s.expect" "%t" // RUN: %OutputCheck --file-to-check "%S/AllExterns.cs" "%s" // CHECK: .*Foo____dafny__checked\(x\).* diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInitCompile.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInitCompile.dfy index 4eb2e93635b..4024873dbdf 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInitCompile.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInitCompile.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char false method Main() { diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Char.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Char.dfy.expect index 81b7dc2926e..9072ce33b98 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Char.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Char.dfy.expect @@ -1,7 +1,10 @@ Char.dfy(48,20): Error: assertion might not hold Char.dfy(52,20): Error: assertion might not hold Char.dfy(63,16): Error: assertion might not hold +Char.dfy(81,7): Error: char subtraction might underflow Char.dfy(81,13): Error: char addition might overflow Char.dfy(89,7): Error: char subtraction might underflow +Char.dfy(97,13): Error: char addition might overflow +Char.dfy(105,7): Error: char subtraction might underflow -Dafny program verifier finished with 8 verified, 5 errors +Dafny program verifier finished with 8 verified, 8 errors diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/Expect.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/Expect.dfy.expect index 57fd8ded85f..e3dc95e1cb0 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/Expect.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/Expect.dfy.expect @@ -1,15 +1,15 @@ -Dafny program verifier finished with 1 verified, 0 errors +Dafny program verifier finished with 0 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation -Dafny program verifier finished with 1 verified, 0 errors +Dafny program verifier finished with 0 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation -Dafny program verifier finished with 1 verified, 0 errors +Dafny program verifier finished with 0 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation -Dafny program verifier finished with 1 verified, 0 errors +Dafny program verifier finished with 0 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation -Dafny program verifier finished with 1 verified, 0 errors +Dafny program verifier finished with 0 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectAndExceptions.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectAndExceptions.dfy.expect index 572284717d0..b9bf0494151 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectAndExceptions.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectAndExceptions.dfy.expect @@ -1,12 +1,15 @@ -Dafny program verifier finished with 2 verified, 0 errors +Dafny program verifier finished with 0 verified, 0 errors [Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") -Dafny program verifier finished with 2 verified, 0 errors +Dafny program verifier finished with 0 verified, 0 errors [Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") -Dafny program verifier finished with 2 verified, 0 errors +Dafny program verifier finished with 0 verified, 0 errors [Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") -Dafny program verifier finished with 2 verified, 0 errors +Dafny program verifier finished with 0 verified, 0 errors +[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") + +Dafny program verifier finished with 0 verified, 0 errors [Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithMessage.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithMessage.dfy.expect index 39cc58df1ca..473ffe58c68 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithMessage.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithMessage.dfy.expect @@ -10,3 +10,6 @@ Dafny program verifier finished with 0 verified, 0 errors Dafny program verifier finished with 0 verified, 0 errors [Program halted] ExpectWithMessage.dfy(8,2): Down with Doublethink! + +Dafny program verifier finished with 0 verified, 0 errors +[Program halted] ExpectWithMessage.dfy(8,2): Down with Doublethink! diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithNonStringMessage.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithNonStringMessage.dfy.expect index f33401eab87..87abba3bccd 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithNonStringMessage.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithNonStringMessage.dfy.expect @@ -2,16 +2,16 @@ Dafny program verifier finished with 0 verified, 0 errors Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(['w', 'h', 'e', 'r', 'e', ' ', 'o', 'v', 'e', 'r', ' ', 't', 'h', 'e', ' ', 'r', 'a', 'i', 'n', 'b', 'o', 'w']) Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(['w', 'h', 'e', 'r', 'e', ' ', 'o', 'v', 'e', 'r', ' ', 't', 'h', 'e', ' ', 'r', 'a', 'i', 'n', 'b', 'o', 'w']) Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(['w', 'h', 'e', 'r', 'e', ' ', 'o', 'v', 'e', 'r', ' ', 't', 'h', 'e', ' ', 'r', 'a', 'i', 'n', 'b', 'o', 'w']) Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(['w', 'h', 'e', 'r', 'e', ' ', 'o', 'v', 'e', 'r', ' ', 't', 'h', 'e', ' ', 'r', 'a', 'i', 'n', 'b', 'o', 'w']) Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(['w', 'h', 'e', 'r', 'e', ' ', 'o', 'v', 'e', 'r', ' ', 't', 'h', 'e', ' ', 'r', 'a', 'i', 'n', 'b', 'o', 'w']) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1100.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1100.dfy index 1ade09660a1..8fda48b372a 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1100.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1100.dfy @@ -1,3 +1,3 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%S/../c++/arrays.dfy" -- --relax-definite-assignment --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%S/../c++/arrays.dfy" -- --relax-definite-assignment --allow-deprecation --unicode-char false // Test compilation of a file in another directory diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-258.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-258.dfy index cd62af53e5d..29c0de3ccb8 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-258.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-258.dfy @@ -1,5 +1,5 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/2582 -// RUN: %testDafnyForEachCompiler "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false method pr(s: seq) { print s, "\n"; diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-2733.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-2733.dfy index 5cab415474e..d84e596ef0c 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-2733.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-2733.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char false method Main() { print "XYZ"; // Checks that no extra newline is added to the output diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-356.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-356.dfy index 3acc92f652d..df4fa854cd9 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-356.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-356.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char:false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char false module M { type Tx = i: int | 0 <= i <= 100 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-3571.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-3571.dfy index cfeee97544d..646d5cbf3eb 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-3571.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-3571.dfy @@ -2,7 +2,7 @@ // RUN: %resolve --function-syntax:4 --function-syntax:3 "%s" > "%t" // RUN: %resolve --quantifier-syntax:3 --quantifier-syntax:4 "%s" >> "%t" // RUN: %build --target:java --target:cs "%s" >> "%t" -// RUN: %resolve --allow-deprecation --unicode-char:false --unicode-char:true "%s" >> "%t" +// RUN: %resolve --allow-deprecation --unicode-char false --unicode-char:true "%s" >> "%t" // RUN: %resolve --prelude "%s" --prelude "%s" "%s" >> "%t" // RUN: %verify --cores:2 --cores:1 "%s" >> "%t" // RUN: %verify --solver-log x.tct --solver-log y.txt "%s" >> "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2928.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2928.dfy index 57e7275e11c..6d4963ae7ab 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2928.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2928.dfy @@ -1,18 +1,3 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --unicode-char -method Main() { - var c := '\0'; - assert c == 0 as char; - expect c == 0 as char; - - var s := "\03"; - - assert |s| == 2; - expect |s| == 2; - - assert s[0] == 0 as char; - expect s[0] == 0 as char; - - assert s[1] == '3'; - expect s[1] == '3'; -} +include "../../git-issues/github-issue-2928.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2989.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2989.dfy index 14d62ec1210..f20d93aa891 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2989.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2989.dfy @@ -1,5 +1,5 @@ // NONUNIFORM: Go-specific regression test -// RUN: %baredafny translate go %args --allow-deprecation --unicode-char:false "%s" > "%t" +// RUN: %baredafny translate go %args --allow-deprecation --unicode-char false "%s" > "%t" // RUN: %baredafny translate go %args --unicode-char:true "%s" >> "%t" // RUN: %diff "%s.expect" "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/separate-verification/app.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/separate-verification/app.dfy index b57a06ce9a2..21e06598f17 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/separate-verification/app.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/separate-verification/app.dfy @@ -20,7 +20,7 @@ // Error cases: mismatched options // RUN: %baredafny build %args -t:lib --unicode-char:true %S/Inputs/wrappers.dfy -// RUN: ! %baredafny build %args -t:lib --allow-deprecation --unicode-char:false %S/Inputs/seq.dfy --library %S/Inputs/wrappers.doo >> %t +// RUN: ! %baredafny build %args -t:lib --allow-deprecation --unicode-char false %S/Inputs/seq.dfy --library %S/Inputs/wrappers.doo >> %t // RUN: %baredafny build %args -t:lib --boogie /vcsLoad:2 %S/Inputs/wrappers.dfy // RUN: ! %baredafny build %args -t:lib %S/Inputs/seq.dfy --library %S/Inputs/wrappers.doo >> %t diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/stdlibs/StandardLibraries_Errors.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/stdlibs/StandardLibraries_Errors.dfy index 7131cbde0f1..8f378b60ea3 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/stdlibs/StandardLibraries_Errors.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/stdlibs/StandardLibraries_Errors.dfy @@ -11,7 +11,7 @@ // Invalid: // RUN: %exits-with 2 %verify "%s" >> "%t" -// RUN: %exits-with 1 %verify --standard-libraries:true --allow-deprecation --unicode-char:false "%s" >> "%t" +// RUN: %exits-with 1 %verify --standard-libraries:true --allow-deprecation --unicode-char false "%s" >> "%t" // RUN: %exits-with 1 %baredafny format --standard-libraries "%s" 2>> "%t" // RUN: %diff "%s.expect" "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/DafnyTests/RunAllTestsOption.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/DafnyTests/RunAllTestsOption.dfy index 11c18d236c3..ca6d2be93d6 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/DafnyTests/RunAllTestsOption.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/DafnyTests/RunAllTestsOption.dfy @@ -1,8 +1,8 @@ -// RUN: %verify --unicode-char --verify-included-files "%s" > "%t" -// RUN: ! %baredafny test %args --unicode-char --no-verify --target:cs "%s" >> "%t" -// RUN: ! %baredafny test %args --unicode-char --no-verify --target:java "%s" >> "%t" -// RUN: ! %baredafny test %args --unicode-char --no-verify --target:go "%s" >> "%t" -// RUN: ! %baredafny test %args --unicode-char --no-verify --target:js "%s" >> "%t" -// RUN: ! %baredafny test %args --unicode-char --no-verify --target:py "%s" >> "%t" +// RUN: %verify --allow-deprecation --unicode-char false --verify-included-files "%s" > "%t" +// RUN: ! %baredafny test %args --allow-deprecation --unicode-char false --no-verify --target:cs "%s" >> "%t" +// RUN: ! %baredafny test %args --allow-deprecation --unicode-char false --no-verify --target:java "%s" >> "%t" +// RUN: ! %baredafny test %args --allow-deprecation --unicode-char false --no-verify --target:go "%s" >> "%t" +// RUN: ! %baredafny test %args --allow-deprecation --unicode-char false --no-verify --target:js "%s" >> "%t" +// RUN: ! %baredafny test %args --allow-deprecation --unicode-char false --no-verify --target:py "%s" >> "%t" // RUN: %diff "%s.expect" "%t" include "../../DafnyTests/RunAllTests/RunAllTestsOption.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/DafnyTests/RunAllTestsOption.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/DafnyTests/RunAllTestsOption.dfy.expect index 5757b59045c..8a79d694bda 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/DafnyTests/RunAllTestsOption.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/DafnyTests/RunAllTestsOption.dfy.expect @@ -1,5 +1,5 @@ -Dafny program verifier finished with 2 verified, 0 errors +Dafny program verifier finished with 1 verified, 0 errors Dafny program verifier did not attempt verification TestModule.Passing1: PASSED @@ -11,8 +11,8 @@ Passing3: PASSED Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED - VoidOutcome.VoidFailure("Whoopsie") -[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. + VoidOutcome.VoidFailure(Whoopsie) +[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. Dafny program verifier did not attempt verification @@ -25,8 +25,8 @@ Passing3: PASSED Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED - VoidOutcome.VoidFailure("Whoopsie") -[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. + VoidOutcome.VoidFailure(Whoopsie) +[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. Dafny program verifier did not attempt verification @@ -39,8 +39,8 @@ Passing3: PASSED Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED - VoidOutcome.VoidFailure("Whoopsie") -[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. + VoidOutcome.VoidFailure(Whoopsie) +[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. Dafny program verifier did not attempt verification @@ -53,8 +53,8 @@ Passing3: PASSED Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED - VoidOutcome.VoidFailure("Whoopsie") -[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. + VoidOutcome.VoidFailure(Whoopsie) +[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. Dafny program verifier did not attempt verification @@ -67,6 +67,20 @@ Passing3: PASSED Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED - VoidOutcome.VoidFailure("Whoopsie") -[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. + VoidOutcome.VoidFailure(Whoopsie) +[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. + + +Dafny program verifier did not attempt verification +TestModule.Passing1: PASSED +Passing1: PASSED +Passing2: PASSED +Failing1: FAILED + RunAllTestsOption.dfy(23,2): expectation violation +Passing3: PASSED +Failing2: FAILED + RunAllTestsOption.dfy(31,2): expectation violation +FailingReturnValue: FAILED + VoidOutcome.VoidFailure(Whoopsie) +[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy index 79b0f1fad99..85795dc9623 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy @@ -1,2 +1,3 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --unicode-char +// NONUNIFORM: https://github.com/dafny-lang/dafny/issues/2582 +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --allow-warnings --unicode-char false include "../../comp/Arrays.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.expect index 4511b0842c8..2ed1a6f3fa8 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.expect @@ -1,3 +1,6 @@ +CLI: Warning: the option unicode-char has been deprecated. + +Dafny program verifier did not attempt verification 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 17 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] @@ -5,8 +8,8 @@ [20, 21, 22] [0, 1, 2, 3, 4, 5, 6, 7] [0, 1, 2, 3, 4, 5, 6, 7] -'d' 'd' 'd' -'h' 'e' 'l' 'l' 'o' +d d d +h e l l o 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 @@ -18,34 +21,34 @@ It's null hi hello tjena hej hola hi hello tjena hej hola hi hello tjena hej hola -'d' 'd' 'd' -'h' 'e' 'l' 'l' 'o' +d d d +h e l l o 8 8 8 8 true true true 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 -('d', 8, true, 1, 2, 3, 4) -'D' 'D' 'D' +(d, 8, true, 1, 2, 3, 4) +D D D 0 0 0 0 false false false 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -('D', 0, false, 0, 0, 0, 0) +(D, 0, false, 0, 0, 0, 0) 8 0 false 0 null null 8 8 8 8 8 8 8 8 -'D' 'D' 'D' -'D' 'D' 'D' -'D' 'D' 'D' -'D' 'D' 'r' ('D', 'D', 'r') -'D' 'D' 'r' +D D D +D D D +D D D +D D r (D, D, r) +D D r [19, 18, 9, 8] true false @@ -81,14 +84,14 @@ hello [0, 1, 2, 3, 4] [2, 2, 2, 2, 2] [0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 20, 21, 22, 23, 24, 60, 60, 60, 60, 60] [0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 20, 21, 22, 23, 24, 60, 60, 60, 60, 60] DDDDDabcdeabcdeggggg -['D', 'D', 'D', 'D', 'D', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'g', 'g', 'g', 'g', 'g'] +DDDDDabcdeabcdeggggg [77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 50, 78, 78, 78, 78, 78, 50, 78, 78, 78] [77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 50, 78, 78, 78, 78, 78, 50, 78, 78, 78] [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 60, 60, 60, 60, 60, 50, 60, 60, 60] -['D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'a', 'g', 'g', 'g', 'g', 'g', 'a', 'g', 'g', 'g'] +DDDDDDDDDDagggggaggg 0 69 50 0 69 50 -'D' 'k' 'n' +D k n false false true true false false diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.expect2 b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.expect2 new file mode 100644 index 00000000000..4511b0842c8 --- /dev/null +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.expect2 @@ -0,0 +1,96 @@ +0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 +17 +[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] +[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] +[20, 21, 22] +[0, 1, 2, 3, 4, 5, 6, 7] +[0, 1, 2, 3, 4, 5, 6, 7] +'d' 'd' 'd' +'h' 'e' 'l' 'l' 'o' +0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 +1 0 0 0 0 +0 1 0 0 0 +0 0 1 0 0 +cube dims: 3 0 4 +[] [0] [0, 0] [0, 0, 0] [0, 0, 0, 0] +It's null +hi hello tjena hej hola +hi hello tjena hej hola +hi hello tjena hej hola +'d' 'd' 'd' +'h' 'e' 'l' 'l' 'o' +8 8 8 8 +true true true +1 1 1 1 1 +2 2 2 2 2 +3 3 3 3 3 +4 4 4 4 4 +('d', 8, true, 1, 2, 3, 4) +'D' 'D' 'D' +0 0 0 0 +false false false +0 0 0 0 0 +0 0 0 0 0 +0 0 0 0 0 +0 0 0 0 0 +('D', 0, false, 0, 0, 0, 0) +8 0 +false 0 null null +8 8 +8 8 +8 8 +8 8 +'D' 'D' 'D' +'D' 'D' 'D' +'D' 'D' 'D' +'D' 'D' 'r' ('D', 'D', 'r') +'D' 'D' 'r' +[19, 18, 9, 8] + true + false + true + false + false + false + true + true + false + true + false + true + true + false +hello there +false false +true true +false false +false false +uninitialized bytes: array[0, 0, 0] +bytes from display: array[7, 8, 9] +bytes from lambda: array[20, 21, 22] +uninitialized 1bytes: array[1, 1, 1] +1bytes from display: array[7, 8, 9] +1bytes from lambda: array[20, 21, 22] +17 19 18 20 +100 200 300 120 38 +hello [0, 1, 2, 3, 4] [2, 2, 2, 2, 2] +[77, 77, 77, 77, 77, 20, 21, 22, 23, 24, 20, 21, 22, 23, 24, 78, 78, 78, 78, 78] +[77, 77, 77, 77, 77, 20, 21, 22, 23, 24, 20, 21, 22, 23, 24, 78, 78, 78, 78, 78] +[99, 99, 99, 99, 99, 20, 21, 22, 23, 24, 20, 21, 22, 23, 24, 82, 82, 82, 82, 82] +[0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 20, 21, 22, 23, 24, 60, 60, 60, 60, 60] +[0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 20, 21, 22, 23, 24, 60, 60, 60, 60, 60] +DDDDDabcdeabcdeggggg +['D', 'D', 'D', 'D', 'D', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'g', 'g', 'g', 'g', 'g'] +[77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 50, 78, 78, 78, 78, 78, 50, 78, 78, 78] +[77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 50, 78, 78, 78, 78, 78, 50, 78, 78, 78] +[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 60, 60, 60, 60, 60, 50, 60, 60, 60] +['D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'a', 'g', 'g', 'g', 'g', 'g', 'a', 'g', 'g', 'g'] +0 69 50 +0 69 50 +'D' 'k' 'n' +false false +true true +false false +false false +true true diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Arrays.dfy.go.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.go.expect similarity index 94% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Arrays.dfy.go.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.go.expect index 1217623d90c..837f7b9b3a3 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Arrays.dfy.go.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.go.expect @@ -1,3 +1,6 @@ +CLI: Warning: the option unicode-char has been deprecated. + +Dafny program verifier did not attempt verification 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 17 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy index 0da2d566e72..f9ba73046bf 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy @@ -1,3 +1,3 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4108 -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:true --verify-included-files +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --verify-included-files include "../../comp/Collections.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.expect index a896b0d701f..7c0fbb1b828 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.expect @@ -12,7 +12,7 @@ Sets: {} {17, 82} {12, 17} eq covariance: 1 true true false true |s|=4 |S|=16 -{{}, {'a'}, {'b'}, {'c'}, {'d'}, {'a', 'b'}, {'a', 'c'}, {'b', 'c'}, {'a', 'd'}, {'b', 'd'}, {'c', 'd'}, {'a', 'b', 'c'}, {'a', 'b', 'd'}, {'a', 'c', 'd'}, {'b', 'c', 'd'}, {'a', 'b', 'c', 'd'}} +{{}, {a}, {b}, {c}, {d}, {a, b}, {a, c}, {b, c}, {a, d}, {b, d}, {c, d}, {a, b, c}, {a, b, d}, {a, c, d}, {b, c, d}, {a, b, c, d}} Multisets: multiset{} multiset{17, 17, 82, 82} multiset{12, 17} cardinality: 0 4 2 union: multiset{17, 17, 82, 82} multiset{12, 17, 17, 17, 82, 82} @@ -48,7 +48,7 @@ Sequences: [] [17, 82, 17, 82] [12, 17] membership: false true true Bound Bound Bound Bound Bound Bound ed ed ed ed ed ed -'e' 'e' 'e' 'e' 'e' 'e' +e e e e e e hello hEllo [2, 4, 6, 8, 10] diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.go.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.go.expect index 7c5ae68b60f..19be6351e0d 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.go.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.go.expect @@ -12,7 +12,7 @@ Sets: {} {17, 82} {12, 17} eq covariance: 1 true true false true |s|=4 |S|=16 -{{}, {'a'}, {'b'}, {'c'}, {'d'}, {'a', 'b'}, {'a', 'c'}, {'b', 'c'}, {'a', 'd'}, {'b', 'd'}, {'c', 'd'}, {'a', 'b', 'c'}, {'a', 'b', 'd'}, {'a', 'c', 'd'}, {'b', 'c', 'd'}, {'a', 'b', 'c', 'd'}} +{{}, {a}, {b}, {c}, {d}, {a, b}, {a, c}, {b, c}, {a, d}, {b, d}, {c, d}, {a, b, c}, {a, b, d}, {a, c, d}, {b, c, d}, {a, b, c, d}} Multisets: multiset{} multiset{17, 17, 82, 82} multiset{12, 17} cardinality: 0 4 2 union: multiset{17, 17, 82, 82} multiset{17, 17, 17, 82, 82, 12} @@ -48,7 +48,7 @@ Sequences: [] [17, 82, 17, 82] [12, 17] membership: false true true Bound Bound Bound Bound Bound Bound ed ed ed ed ed ed -'e' 'e' 'e' 'e' 'e' 'e' +e e e e e e hello hEllo [2, 4, 6, 8, 10] diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.java.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.java.expect index 7b9a3bf1e51..60f096fe133 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.java.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.java.expect @@ -12,7 +12,7 @@ Sets: {} {17, 82} {17, 12} eq covariance: 1 true true false true |s|=4 |S|=16 -{{}, {'a'}, {'b'}, {'c'}, {'d'}, {'a', 'b'}, {'a', 'c'}, {'b', 'c'}, {'a', 'd'}, {'b', 'd'}, {'c', 'd'}, {'a', 'b', 'c'}, {'a', 'b', 'd'}, {'a', 'c', 'd'}, {'b', 'c', 'd'}, {'a', 'b', 'c', 'd'}} +{{}, {a}, {b}, {c}, {d}, {a, b}, {a, c}, {b, c}, {a, d}, {b, d}, {c, d}, {a, b, c}, {a, b, d}, {a, c, d}, {b, c, d}, {a, b, c, d}} Multisets: multiset{} multiset{17, 17, 82, 82} multiset{17, 12} cardinality: 0 4 2 union: multiset{17, 17, 82, 82} multiset{17, 17, 17, 82, 82, 12} @@ -48,7 +48,7 @@ Sequences: [] [17, 82, 17, 82] [12, 17] membership: false true true Bound Bound Bound Bound Bound Bound ed ed ed ed ed ed -'e' 'e' 'e' 'e' 'e' 'e' +e e e e e e hello hEllo [2, 4, 6, 8, 10] diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.js.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.js.expect index 7c5ae68b60f..19be6351e0d 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.js.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.js.expect @@ -12,7 +12,7 @@ Sets: {} {17, 82} {12, 17} eq covariance: 1 true true false true |s|=4 |S|=16 -{{}, {'a'}, {'b'}, {'c'}, {'d'}, {'a', 'b'}, {'a', 'c'}, {'b', 'c'}, {'a', 'd'}, {'b', 'd'}, {'c', 'd'}, {'a', 'b', 'c'}, {'a', 'b', 'd'}, {'a', 'c', 'd'}, {'b', 'c', 'd'}, {'a', 'b', 'c', 'd'}} +{{}, {a}, {b}, {c}, {d}, {a, b}, {a, c}, {b, c}, {a, d}, {b, d}, {c, d}, {a, b, c}, {a, b, d}, {a, c, d}, {b, c, d}, {a, b, c, d}} Multisets: multiset{} multiset{17, 17, 82, 82} multiset{12, 17} cardinality: 0 4 2 union: multiset{17, 17, 82, 82} multiset{17, 17, 17, 82, 82, 12} @@ -48,7 +48,7 @@ Sequences: [] [17, 82, 17, 82] [12, 17] membership: false true true Bound Bound Bound Bound Bound Bound ed ed ed ed ed ed -'e' 'e' 'e' 'e' 'e' 'e' +e e e e e e hello hEllo [2, 4, 6, 8, 10] diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.py.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.py.expect index b68ff60874b..a8cb6f4eb53 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.py.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.py.expect @@ -12,7 +12,7 @@ Sets: {} {17, 82} {17, 12} eq covariance: 1 true true false true |s|=4 |S|=16 -{{}, {'a'}, {'b'}, {'c'}, {'d'}, {'a', 'b'}, {'a', 'c'}, {'b', 'c'}, {'a', 'd'}, {'b', 'd'}, {'c', 'd'}, {'a', 'b', 'c'}, {'a', 'b', 'd'}, {'a', 'c', 'd'}, {'b', 'c', 'd'}, {'a', 'b', 'c', 'd'}} +{{}, {a}, {b}, {c}, {d}, {a, b}, {a, c}, {b, c}, {a, d}, {b, d}, {c, d}, {a, b, c}, {a, b, d}, {a, c, d}, {b, c, d}, {a, b, c, d}} Multisets: multiset{} multiset{17, 17, 82, 82} multiset{12, 17} cardinality: 0 4 2 union: multiset{17, 17, 82, 82} multiset{17, 17, 17, 82, 82, 12} @@ -48,7 +48,7 @@ Sequences: [] [17, 82, 17, 82] [12, 17] membership: false true true Bound Bound Bound Bound Bound Bound ed ed ed ed ed ed -'e' 'e' 'e' 'e' 'e' 'e' +e e e e e e hello hEllo [2, 4, 6, 8, 10] diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/CompileWithArguments.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/CompileWithArguments.dfy index 97ac70bd210..eec263bb957 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/CompileWithArguments.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/CompileWithArguments.dfy @@ -2,28 +2,28 @@ // Note that C++ is not supported yet // RUN: %verify "%s" > "%t" -// RUN: %baredafny run %args --unicode-char --no-verify --target:cs "%s" Csharp 1 >> "%t" -// RUN: %baredafny run %args --unicode-char --no-verify --target:java "%s" -- Java --heya >> "%t" -// RUN: %baredafny run %args --unicode-char --no-verify --target:js "%s" -- Javascript 2 >> "%t" -// RUN: %run --no-verify --unicode-char --target py "%s" Python 1 >> "%t" -// RUN: %run --no-verify --unicode-char --target go "%s" "Go go" 1 >> "%t" -// RUN: %baredafny build %args --unicode-char --no-verify --target:cs "%s" --output:%s.dll +// RUN: %baredafny run %args --allow-deprecation --unicode-char false --no-verify --target:cs "%s" Csharp 1 >> "%t" +// RUN: %baredafny run %args --allow-deprecation --unicode-char false --no-verify --target:java "%s" -- Java --heya >> "%t" +// RUN: %baredafny run %args --allow-deprecation --unicode-char false --no-verify --target:js "%s" -- Javascript 2 >> "%t" +// RUN: %run --no-verify --allow-deprecation --unicode-char false --target py "%s" Python 1 >> "%t" +// RUN: %run --no-verify --allow-deprecation --unicode-char false --target go "%s" "Go go" 1 >> "%t" +// RUN: %baredafny build %args --allow-deprecation --unicode-char false --no-verify --target:cs "%s" --output:%s.dll // RUN: dotnet %s.dll "dotnet" "howdy" >> "%t" // RUN: dotnet %s.dll "dotnet" "hello" >> "%t" // RUN: dotnet %s.dll "dotnet" "aloha" >> "%t" -// RUN: %baredafny build %args --unicode-char --no-verify --target:js "%s" --output=%s.js +// RUN: %baredafny build %args --allow-deprecation --unicode-char false --no-verify --target:js "%s" --output=%s.js // RUN: node %s.js "javascript" 2 >> "%t" // RUN: node %s.js "javascript" 1 >> "%t" // RUN: node %s.js "javascript" "aloha" >> "%t" -// RUN: %baredafny build %args --unicode-char --no-verify --target:java "%s" --output:"%s.jar" >> "%t" +// RUN: %baredafny build %args --allow-deprecation --unicode-char false --no-verify --target:java "%s" --output:"%s.jar" >> "%t" // RUN: java -jar "%s.jar" Java 2 >> "%t" // RUN: java -jar "%s.jar" Java 1 >> "%t" // RUN: java -jar "%s.jar" Java aloha >> "%t" -// RUN: %baredafny build %args --unicode-char --no-verify --target:py "%s" >> "%t" +// RUN: %baredafny build %args --allow-deprecation --unicode-char false --no-verify --target:py "%s" >> "%t" // RUN: python3 %S/CompileWithArguments-py Python 2 >> "%t" // RUN: python3 %S/CompileWithArguments-py Python 1 >> "%t" // RUN: python3 %S/CompileWithArguments-py Python aloha >> "%t" -// RUN: %baredafny build %args --unicode-char --no-verify --target:go "%s" >> "%t" +// RUN: %baredafny build %args --allow-deprecation --unicode-char false --no-verify --target:go "%s" >> "%t" // RUN: env GO111MODULE=auto GOPATH=%S/CompileWithArguments-go go run %S/CompileWithArguments-go/src/CompileWithArguments.go Go 2 >> "%t" // RUN: env GO111MODULE=auto GOPATH=%S/CompileWithArguments-go go run %S/CompileWithArguments-go/src/CompileWithArguments.go Go 1 >> "%t" // RUN: env GO111MODULE=auto GOPATH=%S/CompileWithArguments-go go run %S/CompileWithArguments-go/src/CompileWithArguments.go Go aloha >> "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/CompileWithArguments.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/CompileWithArguments.dfy.expect index f063b7c22c2..b5ed55540d8 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/CompileWithArguments.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/CompileWithArguments.dfy.expect @@ -4,6 +4,9 @@ Dafny program verifier finished with 1 verified, 0 errors Dafny program verifier did not attempt verification Csharp says hello +Dafny program verifier did not attempt verification +Cpp says Yipee + Dafny program verifier did not attempt verification Java says --heya @@ -21,6 +24,9 @@ dotnet says aloha javascript says howdy javascript says hello javascript says aloha +cpp says howdy +cpp says hello +cpp says aloha Dafny program verifier did not attempt verification Java says howdy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternDafnyString.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternDafnyString.dfy index 472f464f860..9d9136c81a4 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternDafnyString.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternDafnyString.dfy @@ -1,4 +1,4 @@ -// RUN: %run --unicode-char --target java "%s" --input %S/ExternDafnyString.java > "%t" +// RUN: %run --allow-deprecation --unicode-char false --target java "%s" --input %S/ExternDafnyString.java > "%t" // RUN: %diff "%s.expect" "%t" // In this example, the extern method obtains a Java string and returns it as a Dafny string. diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternJavaString.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternJavaString.dfy index c217fc036bc..af6ba8406cc 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternJavaString.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternJavaString.dfy @@ -1,4 +1,4 @@ -// RUN: %run --unicode-char --target java "%s" --input %S/Conversions.java --input %S/ExternJavaString.java > "%t" +// RUN: %run --allow-deprecation --unicode-char false --target java "%s" --input %S/Conversions.java --input %S/ExternJavaString.java > "%t" // RUN: %diff "%s.expect" "%t" // In this example, the extern method obtains a Java string and returns it as such. // The Dafny code converts that Java string to a Dafny string. diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/NativeNumbers.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/NativeNumbers.dfy.expect index 354d931a151..6a9d263fc73 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/NativeNumbers.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/NativeNumbers.dfy.expect @@ -28,7 +28,7 @@ Cast from cardinality operator: 4 4 4 4 4 4 4 4 4 Characters: -'C' 67 67 67 67 67 67 67 67 67 +C 67 67 67 67 67 67 67 67 67 0 127 32767 65535 65535 255 65535 65535 65535 Defaults: diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy.expect index 4c6cf5c8a91..bd45e868fd6 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy.expect @@ -33,7 +33,7 @@ 35 27 -27 124 -124 -124 124 -'g' 'Q' '2' +g Q 2 7 3 31 -8 1 -31 -7 3 31 @@ -98,11 +98,11 @@ NativeType: 0 <0 N <=0 Y ==0 Y !=0 N >0 N >=0 Y 0< N 0<= Y 0== Y 0!= N 0> N 0>= Y 0 <0 N <=0 Y ==0 Y !=0 N >0 N >=0 Y 0< N 0<= Y 0== Y 0!= N 0> N 0>= Y 23 <0 N <=0 N ==0 N !=0 Y >0 Y >=0 Y 0< Y 0<= Y 0== N 0!= Y 0> N 0>= N -120 120.0 120 120 120 'x' -120 120.0 120 120 120 'x' +120 120.0 120 120 120 x +120 120.0 120 120 120 x 120 120 -120 120.0 120 120 120 'x' -120 120.0 120 120 120 'x' +120 120.0 120 120 120 x +120 120.0 120 120 120 x 120 120 false true false true true false true false diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy.go.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy.go.expect index 43212d1a81e..8249aa59ada 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy.go.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy.go.expect @@ -33,7 +33,7 @@ 35 27 -27 124 -124 -124 124 -'g' 'Q' '2' +g Q 2 7 3 31 -8 1 -31 -7 3 31 @@ -98,11 +98,11 @@ NativeType: 0 <0 N <=0 Y ==0 Y !=0 N >0 N >=0 Y 0< N 0<= Y 0== Y 0!= N 0> N 0>= Y 0 <0 N <=0 Y ==0 Y !=0 N >0 N >=0 Y 0< N 0<= Y 0== Y 0!= N 0> N 0>= Y 23 <0 N <=0 N ==0 N !=0 Y >0 Y >=0 Y 0< Y 0<= Y 0== N 0!= Y 0> N 0>= N -120 120.0 120 120 120 'x' -120 120.0 120 120 120 'x' +120 120.0 120 120 120 x +120 120.0 120 120 120 x 120 120 -120 120.0 120 120 120 'x' -120 120.0 120 120 120 'x' +120 120.0 120 120 120 x +120 120.0 120 120 120 x 120 120 false true false true true false true false diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy.py.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy.py.expect index 43212d1a81e..8249aa59ada 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy.py.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy.py.expect @@ -33,7 +33,7 @@ 35 27 -27 124 -124 -124 124 -'g' 'Q' '2' +g Q 2 7 3 31 -8 1 -31 -7 3 31 @@ -98,11 +98,11 @@ NativeType: 0 <0 N <=0 Y ==0 Y !=0 N >0 N >=0 Y 0< N 0<= Y 0== Y 0!= N 0> N 0>= Y 0 <0 N <=0 Y ==0 Y !=0 N >0 N >=0 Y 0< N 0<= Y 0== Y 0!= N 0> N 0>= Y 23 <0 N <=0 N ==0 N !=0 Y >0 Y >=0 Y 0< Y 0<= Y 0== N 0!= Y 0> N 0>= N -120 120.0 120 120 120 'x' -120 120.0 120 120 120 'x' +120 120.0 120 120 120 x +120 120.0 120 120 120 x 120 120 -120 120.0 120 120 120 'x' -120 120.0 120 120 120 'x' +120 120.0 120 120 120 x +120 120.0 120 120 120 x 120 120 false true false true true false true false diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/dafny0/Char.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/dafny0/Char.dfy.expect index 9072ce33b98..81b7dc2926e 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/dafny0/Char.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/dafny0/Char.dfy.expect @@ -1,10 +1,7 @@ Char.dfy(48,20): Error: assertion might not hold Char.dfy(52,20): Error: assertion might not hold Char.dfy(63,16): Error: assertion might not hold -Char.dfy(81,7): Error: char subtraction might underflow Char.dfy(81,13): Error: char addition might overflow Char.dfy(89,7): Error: char subtraction might underflow -Char.dfy(97,13): Error: char addition might overflow -Char.dfy(105,7): Error: char subtraction might underflow -Dafny program verifier finished with 8 verified, 8 errors +Dafny program verifier finished with 8 verified, 5 errors diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/Expect.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/Expect.dfy index 009d13ef948..bb80d8a5f6b 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/Expect.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/Expect.dfy @@ -1,7 +1,7 @@ -// RUN: ! %baredafny run --target=cs --unicode-char %args "%s" > "%t" -// RUN: ! %baredafny run --target=go --unicode-char %args "%s" >> "%t" -// RUN: ! %baredafny run --target=java --unicode-char %args "%s" >> "%t" -// RUN: ! %baredafny run --target=js --unicode-char %args "%s" >> "%t" -// RUN: ! %baredafny run --target=py --unicode-char %args "%s" >> "%t" +// RUN: ! %baredafny run --target=cs --allow-deprecation --unicode-char false %args "%s" > "%t" +// RUN: ! %baredafny run --target=go --allow-deprecation --unicode-char false %args "%s" >> "%t" +// RUN: ! %baredafny run --target=java --allow-deprecation --unicode-char false %args "%s" >> "%t" +// RUN: ! %baredafny run --target=js --allow-deprecation --unicode-char false %args "%s" >> "%t" +// RUN: ! %baredafny run --target=py --allow-deprecation --unicode-char false %args "%s" >> "%t" // RUN: %diff "%s.expect" "%t" include "../../expectations/Expect.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/Expect.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/Expect.dfy.expect index e3dc95e1cb0..57fd8ded85f 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/Expect.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/Expect.dfy.expect @@ -1,15 +1,15 @@ -Dafny program verifier finished with 0 verified, 0 errors +Dafny program verifier finished with 1 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation -Dafny program verifier finished with 0 verified, 0 errors +Dafny program verifier finished with 1 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation -Dafny program verifier finished with 0 verified, 0 errors +Dafny program verifier finished with 1 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation -Dafny program verifier finished with 0 verified, 0 errors +Dafny program verifier finished with 1 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation -Dafny program verifier finished with 0 verified, 0 errors +Dafny program verifier finished with 1 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy.expect index b9bf0494151..572284717d0 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy.expect @@ -1,15 +1,12 @@ -Dafny program verifier finished with 0 verified, 0 errors +Dafny program verifier finished with 2 verified, 0 errors [Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") -Dafny program verifier finished with 0 verified, 0 errors +Dafny program verifier finished with 2 verified, 0 errors [Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") -Dafny program verifier finished with 0 verified, 0 errors +Dafny program verifier finished with 2 verified, 0 errors [Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") -Dafny program verifier finished with 0 verified, 0 errors -[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") - -Dafny program verifier finished with 0 verified, 0 errors +Dafny program verifier finished with 2 verified, 0 errors [Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy.expect index 473ffe58c68..39cc58df1ca 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy.expect @@ -10,6 +10,3 @@ Dafny program verifier finished with 0 verified, 0 errors Dafny program verifier finished with 0 verified, 0 errors [Program halted] ExpectWithMessage.dfy(8,2): Down with Doublethink! - -Dafny program verifier finished with 0 verified, 0 errors -[Program halted] ExpectWithMessage.dfy(8,2): Down with Doublethink! diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy.expect index 87abba3bccd..f33401eab87 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy.expect @@ -2,16 +2,16 @@ Dafny program verifier finished with 0 verified, 0 errors Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(['w', 'h', 'e', 'r', 'e', ' ', 'o', 'v', 'e', 'r', ' ', 't', 'h', 'e', ' ', 'r', 'a', 'i', 'n', 'b', 'o', 'w']) +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(['w', 'h', 'e', 'r', 'e', ' ', 'o', 'v', 'e', 'r', ' ', 't', 'h', 'e', ' ', 'r', 'a', 'i', 'n', 'b', 'o', 'w']) +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(['w', 'h', 'e', 'r', 'e', ' ', 'o', 'v', 'e', 'r', ' ', 't', 'h', 'e', ' ', 'r', 'a', 'i', 'n', 'b', 'o', 'w']) +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(['w', 'h', 'e', 'r', 'e', ' ', 'o', 'v', 'e', 'r', ' ', 't', 'h', 'e', ' ', 'r', 'a', 'i', 'n', 'b', 'o', 'w']) +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(['w', 'h', 'e', 'r', 'e', ' ', 'o', 'v', 'e', 'r', ' ', 't', 'h', 'e', ' ', 'r', 'a', 'i', 'n', 'b', 'o', 'w']) +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") diff --git a/Source/TestDafny/MultiBackendTest.cs b/Source/TestDafny/MultiBackendTest.cs index ecc618b7c98..ffb8894f08c 100644 --- a/Source/TestDafny/MultiBackendTest.cs +++ b/Source/TestDafny/MultiBackendTest.cs @@ -339,8 +339,11 @@ private async Task RunWithCompiler(ForEachCompilerOptions options, IExecuta var (exitCode, outputString, error) = await RunDafny(options.DafnyCliPath, dafnyArgs); var compilationOutputPrior = new Regex("\r?\nDafny program verifier[^\r\n]*\r?\n").Match(outputString); + string unsupportedString; if (compilationOutputPrior.Success) { - outputString = outputString.Remove(0, compilationOutputPrior.Index + compilationOutputPrior.Length); + unsupportedString = outputString.Remove(0, compilationOutputPrior.Index + compilationOutputPrior.Length); + } else { + unsupportedString = outputString; } if (exitCode == 0) { @@ -354,10 +357,10 @@ private async Task RunWithCompiler(ForEachCompilerOptions options, IExecuta } // If we hit errors, check for known unsupported features or bugs for this compilation target - if (error == "" && OnlyAllowedOutputLines(backend, outputString)) { + if (error == "" && OnlyUnsupported(backend, unsupportedString)) { return 0; } - + if (checkFile != null) { var outputLines = new List(); // Concatenate stdout and stderr so either can be checked against @@ -373,6 +376,11 @@ private async Task RunWithCompiler(ForEachCompilerOptions options, IExecuta return checkResult; } + // If we hit errors, check for known unsupported features or bugs for this compilation target + if (error == "" && OnlyAllowedOutputLines(backend, outputString)) { + return 0; + } + await output.WriteLineAsync("Execution failed, for reasons other than known unsupported features. Output:"); await output.WriteLineAsync(outputString); await output.WriteLineAsync("Error:"); @@ -413,6 +421,42 @@ public static IList ReadAllLines(string s) { return (exitCode, outputWriter.ToString(), errorWriter.ToString()); } + private static bool OnlyUnsupported(IExecutableBackend backend, string output) { + using StringReader sr = new StringReader(output); + if (output == "") { + return false; + } + while (sr.ReadLine() is { } line) { + if (!IsSupportedFeatureLine(backend, line)) { + return false; + } + } + + return true; + } + + private static bool IsSupportedFeatureLine(IExecutableBackend backend, string line) { + line = line.Trim(); + if (line.Length == 0) { + return true; + } + + var prefixIndex = line.IndexOf(UnsupportedFeatureException.MessagePrefix, StringComparison.Ordinal); + if (prefixIndex < 0) { + return false; + } + + var featureDescription = line[(prefixIndex + UnsupportedFeatureException.MessagePrefix.Length)..]; + var feature = FeatureDescriptionAttribute.ForDescription(featureDescription); + if (backend.UnsupportedFeatures.Contains(feature)) { + return true; + } + + // This is an internal inconsistency error + throw new Exception( + $"Compiler rejected feature '{feature}', which is not an element of its UnsupportedFeatures set"); + } + private static bool OnlyAllowedOutputLines(IExecutableBackend backend, string output) { using StringReader sr = new StringReader(output); if (output == "") { From e930eead7256aea76e831312e79f0fd9c586aee5 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Mon, 8 Apr 2024 14:00:28 +0200 Subject: [PATCH 07/26] Updates --- .../DafnyTests/RunAllTests/RunAllTestsOption.dfy | 12 ++++++------ .../LitTests/LitTest/comp/CompileWithArguments.dfy | 5 ----- .../LitTests/LitTest/comp/Comprehensions.dfy | 2 +- .../LitTests/LitTest/comp/ExternDafnyString.dfy | 2 +- .../LitTests/LitTest/comp/NativeNumbers.dfy | 2 +- .../TestFiles/LitTests/LitTest/comp/Numbers.dfy | 2 +- .../TestFiles/LitTests/LitTest/dafny0/Char.dfy | 2 +- .../LitTest/git-issues/git-issue-356-errors.dfy | 2 +- .../LitTests/LitTest/git-issues/git-issue-3571.dfy | 2 +- .../LitTest/git-issues/github-issue-2989.dfy | 2 +- .../LitTests/LitTest/separate-verification/app.dfy | 2 +- .../unicodechars/comp/CompileWithArguments.dfy | 5 +++++ .../LitTest/unicodechars/comp/Comprehensions.dfy | 2 +- .../LitTest/unicodechars/comp/ExternJavaString.dfy | 2 +- .../LitTest/unicodechars/comp/NativeNumbers.dfy | 2 +- .../LitTests/LitTest/unicodechars/comp/Numbers.dfy | 2 +- .../LitTests/LitTest/unicodechars/dafny0/Char.dfy | 2 +- .../expectations/ExpectAndExceptions.dfy | 10 +++++----- .../unicodechars/expectations/ExpectWithMessage.dfy | 10 +++++----- .../expectations/ExpectWithNonStringMessage.dfy | 12 ++++++------ 20 files changed, 41 insertions(+), 41 deletions(-) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy index 46140cf90cd..8e02b5f5482 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy @@ -1,11 +1,11 @@ // RUN: %verify "%s" > "%t" -// RUN: %translate cs %args %s --include-runtime --include-test-runner --allow-deprecation --unicode-char false --no-verify --output %S/Output/manual/program.cs >> "%t" +// RUN: %translate cs %args %s --include-runtime --include-test-runner --no-verify --output %S/Output/manual/program.cs >> "%t" // RUN: ! dotnet run -v q --property WarningLevel=0 --project %S/RunAllTests.csproj >> "%t" -// RUN: ! %baredafny test %args --allow-deprecation --unicode-char false --no-verify --target:cs "%s" >> "%t" -// RUN: ! %baredafny test %args --allow-deprecation --unicode-char false --no-verify --target:java "%s" >> "%t" -// RUN: ! %baredafny test %args --allow-deprecation --unicode-char false --no-verify --target:go "%s" >> "%t" -// RUN: ! %baredafny test %args --allow-deprecation --unicode-char false --no-verify --target:js "%s" >> "%t" -// RUN: ! %baredafny test %args --allow-deprecation --unicode-char false --no-verify --target:py "%s" >> "%t" +// RUN: ! %baredafny test %args --no-verify --target:cs "%s" >> "%t" +// RUN: ! %baredafny test %args --no-verify --target:java "%s" >> "%t" +// RUN: ! %baredafny test %args --no-verify --target:go "%s" >> "%t" +// RUN: ! %baredafny test %args --no-verify --target:js "%s" >> "%t" +// RUN: ! %baredafny test %args --no-verify --target:py "%s" >> "%t" // RUN: %diff "%s.expect" "%t" include "../../exceptions/VoidOutcomeDt.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArguments.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArguments.dfy index d5a6fd29ab0..7475394416e 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArguments.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/CompileWithArguments.dfy @@ -1,7 +1,6 @@ // NONUNIFORM: Multiple testing scenarios, highly backend sensitive, testing CLI // RUN: %verify "%s" > "%t" // RUN: %run --no-verify --target:cs "%s" Csharp 1 >> "%t" -// RUN: %run --no-verify --target:cpp --allow-deprecation --unicode-char false "%s" Cpp Yipee >> "%t" // RUN: %run --no-verify --target:java "%s" -- Java --heya >> "%t" // RUN: %run --no-verify --target:js "%s" -- Javascript 2 >> "%t" // RUN: %run --no-verify --target py "%s" Python 1 >> "%t" @@ -14,10 +13,6 @@ // RUN: node %s.js "javascript" 2 >> "%t" // RUN: node %s.js "javascript" 1 >> "%t" // RUN: node %s.js "javascript" "aloha" >> "%t" -// RUN: %build --no-verify --target:cpp --allow-deprecation --unicode-char false "%s" --output=%s.exe -// RUN: %s.exe "cpp" 2 >> "%t" -// RUN: %s.exe "cpp" 1 >> "%t" -// RUN: %s.exe "cpp" "aloha" >> "%t" // RUN: %build --no-verify --target:java "%s" --output:"%s.jar" >> "%t" // RUN: java -jar "%s.jar" Java 2 >> "%t" // RUN: java -jar "%s.jar" Java 1 >> "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Comprehensions.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Comprehensions.dfy index e463c792200..0cdad5075c1 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Comprehensions.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Comprehensions.dfy @@ -1,5 +1,5 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4108 -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation method Main() { AssignSuchThat(); diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternDafnyString.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternDafnyString.dfy index be8aa8e0d9c..feb18533bfa 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternDafnyString.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternDafnyString.dfy @@ -1,4 +1,4 @@ -// RUN: %run --allow-deprecation --unicode-char false --target java "%s" --input %S/Conversions.java --input %S/ExternDafnyString.java > "%t" +// RUN: %run --target java "%s" --input %S/Conversions.java --input %S/ExternDafnyString.java > "%t" // RUN: %diff "%s.expect" "%t" // In this example, the extern method obtains a Java string and returns it as a Dafny string. diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/NativeNumbers.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/NativeNumbers.dfy index 8781c62c159..25be5924113 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/NativeNumbers.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/NativeNumbers.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation // Skip JavaScript because JavaScript doesn't have the same native types diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy index 9743fe543e3..e446b5d5f16 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Numbers.dfy @@ -1,5 +1,5 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4174 -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment method Main() { Literals(); diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Char.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Char.dfy index 15995cf086a..14b52ecbac0 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Char.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Char.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --allow-deprecation --unicode-char=false +// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- class CharChar { diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-356-errors.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-356-errors.dfy index ad1153a3e41..fb4fc733b92 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-356-errors.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-356-errors.dfy @@ -1,4 +1,4 @@ -// RUN: %exits-with 4 %verify "%s" > "%t" +// RUN: %exits-with 4 %verify --allow-deprecation --unicode-char false "%s" > "%t" // RUN: %diff "%s.expect" "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-3571.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-3571.dfy index 646d5cbf3eb..d3d6a527ac3 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-3571.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-3571.dfy @@ -2,7 +2,7 @@ // RUN: %resolve --function-syntax:4 --function-syntax:3 "%s" > "%t" // RUN: %resolve --quantifier-syntax:3 --quantifier-syntax:4 "%s" >> "%t" // RUN: %build --target:java --target:cs "%s" >> "%t" -// RUN: %resolve --allow-deprecation --unicode-char false --unicode-char:true "%s" >> "%t" +// RUN: %resolve --unicode-char false --unicode-char true "%s" >> "%t" // RUN: %resolve --prelude "%s" --prelude "%s" "%s" >> "%t" // RUN: %verify --cores:2 --cores:1 "%s" >> "%t" // RUN: %verify --solver-log x.tct --solver-log y.txt "%s" >> "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2989.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2989.dfy index f20d93aa891..6455b9f8fb5 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2989.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2989.dfy @@ -1,6 +1,6 @@ // NONUNIFORM: Go-specific regression test // RUN: %baredafny translate go %args --allow-deprecation --unicode-char false "%s" > "%t" -// RUN: %baredafny translate go %args --unicode-char:true "%s" >> "%t" +// RUN: %baredafny translate go %args --unicode-char true "%s" >> "%t" // RUN: %diff "%s.expect" "%t" method Main() { diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/separate-verification/app.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/separate-verification/app.dfy index 21e06598f17..c9bc3e4e8f7 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/separate-verification/app.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/separate-verification/app.dfy @@ -19,7 +19,7 @@ // Error cases: mismatched options -// RUN: %baredafny build %args -t:lib --unicode-char:true %S/Inputs/wrappers.dfy +// RUN: %baredafny build %args -t:lib --unicode-char true %S/Inputs/wrappers.dfy // RUN: ! %baredafny build %args -t:lib --allow-deprecation --unicode-char false %S/Inputs/seq.dfy --library %S/Inputs/wrappers.doo >> %t // RUN: %baredafny build %args -t:lib --boogie /vcsLoad:2 %S/Inputs/wrappers.dfy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/CompileWithArguments.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/CompileWithArguments.dfy index eec263bb957..3a288777615 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/CompileWithArguments.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/CompileWithArguments.dfy @@ -3,6 +3,7 @@ // RUN: %verify "%s" > "%t" // RUN: %baredafny run %args --allow-deprecation --unicode-char false --no-verify --target:cs "%s" Csharp 1 >> "%t" +// RUN: %run --no-verify --target:cpp --allow-deprecation --unicode-char false "%s" Cpp Yipee >> "%t" // RUN: %baredafny run %args --allow-deprecation --unicode-char false --no-verify --target:java "%s" -- Java --heya >> "%t" // RUN: %baredafny run %args --allow-deprecation --unicode-char false --no-verify --target:js "%s" -- Javascript 2 >> "%t" // RUN: %run --no-verify --allow-deprecation --unicode-char false --target py "%s" Python 1 >> "%t" @@ -15,6 +16,10 @@ // RUN: node %s.js "javascript" 2 >> "%t" // RUN: node %s.js "javascript" 1 >> "%t" // RUN: node %s.js "javascript" "aloha" >> "%t" +// RUN: %build --no-verify --target:cpp --allow-deprecation --unicode-char false "%s" --output=%s.exe +// RUN: %s.exe "cpp" 2 >> "%t" +// RUN: %s.exe "cpp" 1 >> "%t" +// RUN: %s.exe "cpp" "aloha" >> "%t" // RUN: %baredafny build %args --allow-deprecation --unicode-char false --no-verify --target:java "%s" --output:"%s.jar" >> "%t" // RUN: java -jar "%s.jar" Java 2 >> "%t" // RUN: java -jar "%s.jar" Java 1 >> "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Comprehensions.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Comprehensions.dfy index cf9c3925f29..fca16e61569 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Comprehensions.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Comprehensions.dfy @@ -1,3 +1,3 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4108 -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:true --verify-included-files +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false --verify-included-files include "../../comp/Comprehensions.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternJavaString.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternJavaString.dfy index af6ba8406cc..a051bb27b5c 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternJavaString.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternJavaString.dfy @@ -1,4 +1,4 @@ -// RUN: %run --allow-deprecation --unicode-char false --target java "%s" --input %S/Conversions.java --input %S/ExternJavaString.java > "%t" +// RUN: %run --target java "%s" --input %S/Conversions.java --input %S/ExternJavaString.java > "%t" // RUN: %diff "%s.expect" "%t" // In this example, the extern method obtains a Java string and returns it as such. // The Dafny code converts that Java string to a Dafny string. diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/NativeNumbers.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/NativeNumbers.dfy index 4769aaf5210..c6bc80f78c2 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/NativeNumbers.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/NativeNumbers.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --unicode-char:true --verify-included-files +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false --verify-included-files // Skip JavaScript because JavaScript doesn't have the same native types include "../../comp/NativeNumbers.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy index bf3097065db..3293ce6bedc 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy @@ -1,3 +1,3 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4174 -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --unicode-char:true --verify-included-files +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --unicode-char false --verify-included-files -verify-included-files include "../../comp/Numbers.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/dafny0/Char.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/dafny0/Char.dfy index 29d2cbcf205..c7c16ae765d 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/dafny0/Char.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/dafny0/Char.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --allow-deprecation +// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --allow-deprecation --unicode-char false class CharChar { diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy index 7f5bdcc8c25..3cf323d8382 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy @@ -1,7 +1,7 @@ -// RUN: ! %run --target cs "%s" > "%t" -// RUN: ! %run --target go "%s" >> "%t" -// RUN: ! %run --target java "%s" >> "%t" -// RUN: ! %run --target js "%s" >> "%t" -// RUN: ! %run --target py "%s" >> "%t" +// RUN: ! %run --target cs --allow-deprecation --unicode-char "%s" > "%t" +// RUN: ! %run --target go --allow-deprecation --unicode-char "%s" >> "%t" +// RUN: ! %run --target java --allow-deprecation --unicode-char "%s" >> "%t" +// RUN: ! %run --target js --allow-deprecation --unicode-char "%s" >> "%t" +// RUN: ! %run --target py --allow-deprecation --unicode-char "%s" >> "%t" // RUN: %diff "%s.expect" "%t" include "../../expectations/ExpectAndExceptions.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy index cde0cfb17bb..f705729579b 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy @@ -1,7 +1,7 @@ -// RUN: ! %run --target cs "%s" > "%t" -// RUN: ! %run --target go "%s" >> "%t" -// RUN: ! %run --target java "%s" >> "%t" -// RUN: ! %run --target js "%s" >> "%t" -// RUN: ! %run --target py "%s" >> "%t" +// RUN: ! %run --target cs --allow-deprecation --unicode-char "%s" > "%t" +// RUN: ! %run --target go --allow-deprecation --unicode-char "%s" >> "%t" +// RUN: ! %run --target java --allow-deprecation --unicode-char "%s" >> "%t" +// RUN: ! %run --target js --allow-deprecation --unicode-char "%s" >> "%t" +// RUN: ! %run --target py --allow-deprecation --unicode-char "%s" >> "%t" // RUN: %diff "%s.expect" "%t" include "../../expectations/ExpectWithMessage.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy index 60e192d8119..f000ae418b7 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy @@ -1,9 +1,9 @@ -// RUN: %verify --verify-included-files "%s" > "%t" -// RUN: ! %run --no-verify --target cs "%s" >> "%t" -// RUN: ! %run --no-verify --target go "%s" >> "%t" -// RUN: ! %run --no-verify --target java "%s" >> "%t" -// RUN: ! %run --no-verify --target js "%s" >> "%t" -// RUN: ! %run --no-verify --target py "%s" >> "%t" +// RUN: %verify --verify-included-files --allow-deprecation --unicode-char "%s" > "%t" +// RUN: ! %run --no-verify --target cs --allow-deprecation --unicode-char "%s" >> "%t" +// RUN: ! %run --no-verify --target go --allow-deprecation --unicode-char "%s" >> "%t" +// RUN: ! %run --no-verify --target java --allow-deprecation --unicode-char "%s" >> "%t" +// RUN: ! %run --no-verify --target js "--allow-deprecation --unicode-char %s" >> "%t" +// RUN: ! %run --no-verify --target py --allow-deprecation --unicode-char "%s" >> "%t" // RUN: %diff "%s.expect" "%t" // Note this is one good example of printing regressing with /unicodeChar:1 From 3f8a04763d1400cb7f6cbc503a6478177e02c14b Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Tue, 9 Apr 2024 15:39:50 +0200 Subject: [PATCH 08/26] Fixes --- Source/DafnyCore/Verifier/BoogieGenerator.cs | 3 - Source/DafnyDriver/CliCompilation.cs | 5 + .../LitTest/unicodechars/comp/Arrays.dfy | 2 +- .../unicodechars/comp/Arrays.dfy.expect | 3 - .../unicodechars/comp/Arrays.dfy.expect2 | 96 ------------------- .../unicodechars/comp/Arrays.dfy.go.expect | 3 - .../comp/Arrays.dfy.verifier.expect | 1 + Source/TestDafny/MultiBackendTest.cs | 22 +++-- 8 files changed, 20 insertions(+), 115 deletions(-) delete mode 100644 Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.expect2 create mode 100644 Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.verifier.expect diff --git a/Source/DafnyCore/Verifier/BoogieGenerator.cs b/Source/DafnyCore/Verifier/BoogieGenerator.cs index 83e21633a47..115116be897 100644 --- a/Source/DafnyCore/Verifier/BoogieGenerator.cs +++ b/Source/DafnyCore/Verifier/BoogieGenerator.cs @@ -672,9 +672,6 @@ Bpl.Program ReadPrelude() { } if (options.Get(CommonOptionBag.UnicodeCharacters)) { defines.Add("UNICODE_CHAR"); - } else { - reporter.Deprecated(MessageSource.Verifier, "unicodeCharDeprecated", Token.Cli, - "the option unicode-char has been deprecated."); } int errorCount = BplParser.Parse(preludePath, defines, out var prelude); if (prelude == null || errorCount > 0) { diff --git a/Source/DafnyDriver/CliCompilation.cs b/Source/DafnyDriver/CliCompilation.cs index 6afcacefa3b..8c237d7db8b 100644 --- a/Source/DafnyDriver/CliCompilation.cs +++ b/Source/DafnyDriver/CliCompilation.cs @@ -152,6 +152,11 @@ public void Start() { public bool VerifiedAssertions { get; private set; } public async IAsyncEnumerable VerifyAllLazily(int? randomSeed) { + if (!Options.Get(CommonOptionBag.UnicodeCharacters)) { + Compilation.Reporter.Deprecated(MessageSource.Verifier, "unicodeCharDeprecated", Token.Cli, + "the option unicode-char has been deprecated."); + } + var canVerifyResults = new Dictionary(); using var subscription = Compilation.Updates.Subscribe(ev => { diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy index 85795dc9623..c6cae61ccc5 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy @@ -1,3 +1,3 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/2582 -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --allow-warnings --unicode-char false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-warnings --unicode-char false --verify-included-files include "../../comp/Arrays.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.expect index 2ed1a6f3fa8..ef3b884f98a 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.expect @@ -1,6 +1,3 @@ -CLI: Warning: the option unicode-char has been deprecated. - -Dafny program verifier did not attempt verification 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 17 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.expect2 b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.expect2 deleted file mode 100644 index 4511b0842c8..00000000000 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.expect2 +++ /dev/null @@ -1,96 +0,0 @@ -0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 -17 -[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] -[2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] -[20, 21, 22] -[0, 1, 2, 3, 4, 5, 6, 7] -[0, 1, 2, 3, 4, 5, 6, 7] -'d' 'd' 'd' -'h' 'e' 'l' 'l' 'o' -0 0 0 0 0 0 0 0 -0 0 0 0 0 0 0 0 -1 0 0 0 0 -0 1 0 0 0 -0 0 1 0 0 -cube dims: 3 0 4 -[] [0] [0, 0] [0, 0, 0] [0, 0, 0, 0] -It's null -hi hello tjena hej hola -hi hello tjena hej hola -hi hello tjena hej hola -'d' 'd' 'd' -'h' 'e' 'l' 'l' 'o' -8 8 8 8 -true true true -1 1 1 1 1 -2 2 2 2 2 -3 3 3 3 3 -4 4 4 4 4 -('d', 8, true, 1, 2, 3, 4) -'D' 'D' 'D' -0 0 0 0 -false false false -0 0 0 0 0 -0 0 0 0 0 -0 0 0 0 0 -0 0 0 0 0 -('D', 0, false, 0, 0, 0, 0) -8 0 -false 0 null null -8 8 -8 8 -8 8 -8 8 -'D' 'D' 'D' -'D' 'D' 'D' -'D' 'D' 'D' -'D' 'D' 'r' ('D', 'D', 'r') -'D' 'D' 'r' -[19, 18, 9, 8] - true - false - true - false - false - false - true - true - false - true - false - true - true - false -hello there -false false -true true -false false -false false -uninitialized bytes: array[0, 0, 0] -bytes from display: array[7, 8, 9] -bytes from lambda: array[20, 21, 22] -uninitialized 1bytes: array[1, 1, 1] -1bytes from display: array[7, 8, 9] -1bytes from lambda: array[20, 21, 22] -17 19 18 20 -100 200 300 120 38 -hello [0, 1, 2, 3, 4] [2, 2, 2, 2, 2] -[77, 77, 77, 77, 77, 20, 21, 22, 23, 24, 20, 21, 22, 23, 24, 78, 78, 78, 78, 78] -[77, 77, 77, 77, 77, 20, 21, 22, 23, 24, 20, 21, 22, 23, 24, 78, 78, 78, 78, 78] -[99, 99, 99, 99, 99, 20, 21, 22, 23, 24, 20, 21, 22, 23, 24, 82, 82, 82, 82, 82] -[0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 20, 21, 22, 23, 24, 60, 60, 60, 60, 60] -[0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 20, 21, 22, 23, 24, 60, 60, 60, 60, 60] -DDDDDabcdeabcdeggggg -['D', 'D', 'D', 'D', 'D', 'a', 'b', 'c', 'd', 'e', 'a', 'b', 'c', 'd', 'e', 'g', 'g', 'g', 'g', 'g'] -[77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 50, 78, 78, 78, 78, 78, 50, 78, 78, 78] -[77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 50, 78, 78, 78, 78, 78, 50, 78, 78, 78] -[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 60, 60, 60, 60, 60, 50, 60, 60, 60] -['D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'a', 'g', 'g', 'g', 'g', 'g', 'a', 'g', 'g', 'g'] -0 69 50 -0 69 50 -'D' 'k' 'n' -false false -true true -false false -false false -true true diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.go.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.go.expect index 837f7b9b3a3..1217623d90c 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.go.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.go.expect @@ -1,6 +1,3 @@ -CLI: Warning: the option unicode-char has been deprecated. - -Dafny program verifier did not attempt verification 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 17 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.verifier.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.verifier.expect new file mode 100644 index 00000000000..7a3bd9bc85d --- /dev/null +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.verifier.expect @@ -0,0 +1 @@ +CLI: Warning: the option unicode-char has been deprecated. diff --git a/Source/TestDafny/MultiBackendTest.cs b/Source/TestDafny/MultiBackendTest.cs index ffb8894f08c..6124c3f6f91 100644 --- a/Source/TestDafny/MultiBackendTest.cs +++ b/Source/TestDafny/MultiBackendTest.cs @@ -339,12 +339,16 @@ private async Task RunWithCompiler(ForEachCompilerOptions options, IExecuta var (exitCode, outputString, error) = await RunDafny(options.DafnyCliPath, dafnyArgs); var compilationOutputPrior = new Regex("\r?\nDafny program verifier[^\r\n]*\r?\n").Match(outputString); - string unsupportedString; + if (compilationOutputPrior.Success) { - unsupportedString = outputString.Remove(0, compilationOutputPrior.Index + compilationOutputPrior.Length); - } else { - unsupportedString = outputString; + outputString = outputString.Remove(0, compilationOutputPrior.Index + compilationOutputPrior.Length); } + // string unsupportedString; + // if (compilationOutputPrior.Success) { + // unsupportedString = outputString.Remove(0, compilationOutputPrior.Index + compilationOutputPrior.Length); + // } else { + // unsupportedString = outputString; + // } if (exitCode == 0) { var diffMessage = AssertWithDiff.GetDiffMessage(expectedOutput, outputString); @@ -357,7 +361,7 @@ private async Task RunWithCompiler(ForEachCompilerOptions options, IExecuta } // If we hit errors, check for known unsupported features or bugs for this compilation target - if (error == "" && OnlyUnsupported(backend, unsupportedString)) { + if (error == "" && HasUnsupported(backend, outputString)) { return 0; } @@ -421,18 +425,18 @@ public static IList ReadAllLines(string s) { return (exitCode, outputWriter.ToString(), errorWriter.ToString()); } - private static bool OnlyUnsupported(IExecutableBackend backend, string output) { + private static bool HasUnsupported(IExecutableBackend backend, string output) { using StringReader sr = new StringReader(output); if (output == "") { return false; } while (sr.ReadLine() is { } line) { - if (!IsSupportedFeatureLine(backend, line)) { - return false; + if (IsSupportedFeatureLine(backend, line)) { + return true; } } - return true; + return false; } private static bool IsSupportedFeatureLine(IExecutableBackend backend, string line) { From 8cddd7bb9b26ebedcac39398e0c6a1fa6ddeda3a Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Tue, 9 Apr 2024 15:40:14 +0200 Subject: [PATCH 09/26] Cleanup --- Source/DafnyDriver/CliCompilation.cs | 2 +- Source/TestDafny/MultiBackendTest.cs | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Source/DafnyDriver/CliCompilation.cs b/Source/DafnyDriver/CliCompilation.cs index 8c237d7db8b..f699909eee8 100644 --- a/Source/DafnyDriver/CliCompilation.cs +++ b/Source/DafnyDriver/CliCompilation.cs @@ -156,7 +156,7 @@ public async IAsyncEnumerable VerifyAllLazily(int? randomSeed) Compilation.Reporter.Deprecated(MessageSource.Verifier, "unicodeCharDeprecated", Token.Cli, "the option unicode-char has been deprecated."); } - + var canVerifyResults = new Dictionary(); using var subscription = Compilation.Updates.Subscribe(ev => { diff --git a/Source/TestDafny/MultiBackendTest.cs b/Source/TestDafny/MultiBackendTest.cs index 6124c3f6f91..2598b3d6a2b 100644 --- a/Source/TestDafny/MultiBackendTest.cs +++ b/Source/TestDafny/MultiBackendTest.cs @@ -339,16 +339,10 @@ private async Task RunWithCompiler(ForEachCompilerOptions options, IExecuta var (exitCode, outputString, error) = await RunDafny(options.DafnyCliPath, dafnyArgs); var compilationOutputPrior = new Regex("\r?\nDafny program verifier[^\r\n]*\r?\n").Match(outputString); - + if (compilationOutputPrior.Success) { outputString = outputString.Remove(0, compilationOutputPrior.Index + compilationOutputPrior.Length); } - // string unsupportedString; - // if (compilationOutputPrior.Success) { - // unsupportedString = outputString.Remove(0, compilationOutputPrior.Index + compilationOutputPrior.Length); - // } else { - // unsupportedString = outputString; - // } if (exitCode == 0) { var diffMessage = AssertWithDiff.GetDiffMessage(expectedOutput, outputString); @@ -364,7 +358,7 @@ private async Task RunWithCompiler(ForEachCompilerOptions options, IExecuta if (error == "" && HasUnsupported(backend, outputString)) { return 0; } - + if (checkFile != null) { var outputLines = new List(); // Concatenate stdout and stderr so either can be checked against @@ -438,7 +432,7 @@ private static bool HasUnsupported(IExecutableBackend backend, string output) { return false; } - + private static bool IsSupportedFeatureLine(IExecutableBackend backend, string line) { line = line.Trim(); if (line.Length == 0) { @@ -460,7 +454,7 @@ private static bool IsSupportedFeatureLine(IExecutableBackend backend, string li throw new Exception( $"Compiler rejected feature '{feature}', which is not an element of its UnsupportedFeatures set"); } - + private static bool OnlyAllowedOutputLines(IExecutableBackend backend, string output) { using StringReader sr = new StringReader(output); if (output == "") { From 59fa7989a6a3a44694fbda6acd53c5b4dc285703 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Wed, 10 Apr 2024 12:14:16 +0200 Subject: [PATCH 10/26] Update expect files --- .../RunAllTests/RunAllTestsOption.dfy.expect | 26 ++++++++++++++----- .../DafnyTests/RunAllTestsOption.dfy.expect | 26 +++++-------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy.expect index 5757b59045c..20ae853bf7a 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/DafnyTests/RunAllTests/RunAllTestsOption.dfy.expect @@ -1,5 +1,5 @@ -Dafny program verifier finished with 2 verified, 0 errors +Dafny program verifier finished with 1 verified, 0 errors Dafny program verifier did not attempt verification TestModule.Passing1: PASSED @@ -12,7 +12,7 @@ Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED VoidOutcome.VoidFailure("Whoopsie") -[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. +[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. Dafny program verifier did not attempt verification @@ -26,7 +26,7 @@ Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED VoidOutcome.VoidFailure("Whoopsie") -[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. +[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. Dafny program verifier did not attempt verification @@ -40,7 +40,7 @@ Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED VoidOutcome.VoidFailure("Whoopsie") -[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. +[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. Dafny program verifier did not attempt verification @@ -54,7 +54,7 @@ Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED VoidOutcome.VoidFailure("Whoopsie") -[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. +[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. Dafny program verifier did not attempt verification @@ -68,5 +68,19 @@ Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED VoidOutcome.VoidFailure("Whoopsie") -[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. +[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. + + +Dafny program verifier did not attempt verification +TestModule.Passing1: PASSED +Passing1: PASSED +Passing2: PASSED +Failing1: FAILED + RunAllTestsOption.dfy(23,2): expectation violation +Passing3: PASSED +Failing2: FAILED + RunAllTestsOption.dfy(31,2): expectation violation +FailingReturnValue: FAILED + VoidOutcome.VoidFailure("Whoopsie") +[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/DafnyTests/RunAllTestsOption.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/DafnyTests/RunAllTestsOption.dfy.expect index 8a79d694bda..ab946debb7a 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/DafnyTests/RunAllTestsOption.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/DafnyTests/RunAllTestsOption.dfy.expect @@ -1,5 +1,5 @@ -Dafny program verifier finished with 1 verified, 0 errors +Dafny program verifier finished with 2 verified, 0 errors Dafny program verifier did not attempt verification TestModule.Passing1: PASSED @@ -12,7 +12,7 @@ Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED VoidOutcome.VoidFailure(Whoopsie) -[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. +[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. Dafny program verifier did not attempt verification @@ -26,7 +26,7 @@ Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED VoidOutcome.VoidFailure(Whoopsie) -[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. +[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. Dafny program verifier did not attempt verification @@ -40,7 +40,7 @@ Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED VoidOutcome.VoidFailure(Whoopsie) -[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. +[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. Dafny program verifier did not attempt verification @@ -54,7 +54,7 @@ Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED VoidOutcome.VoidFailure(Whoopsie) -[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. +[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. Dafny program verifier did not attempt verification @@ -68,19 +68,5 @@ Failing2: FAILED RunAllTestsOption.dfy(31,2): expectation violation FailingReturnValue: FAILED VoidOutcome.VoidFailure(Whoopsie) -[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. - - -Dafny program verifier did not attempt verification -TestModule.Passing1: PASSED -Passing1: PASSED -Passing2: PASSED -Failing1: FAILED - RunAllTestsOption.dfy(23,2): expectation violation -Passing3: PASSED -Failing2: FAILED - RunAllTestsOption.dfy(31,2): expectation violation -FailingReturnValue: FAILED - VoidOutcome.VoidFailure(Whoopsie) -[Program halted] RunAllTestsOption.dfy(11,0): Test failures occurred: see above. +[Program halted] RunAllTestsOption.dfy(8,0): Test failures occurred: see above. From 347caed6248db37d266ffdae9dff079bcfb647c4 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Wed, 10 Apr 2024 12:24:25 +0200 Subject: [PATCH 11/26] Fix tests --- .../LitTests/LitTest/dafny0/Char.dfy | 30 ++++++++++++++----- .../LitTest/expectations/Expect.dfy.expect | 10 +++---- .../expectations/ExpectWithMessage.dfy.expect | 3 -- .../LitTest/git-issues/git-issue-5238.dfy | 2 +- .../LitTest/unicodechars/comp/Numbers.dfy | 2 +- .../LitTest/unicodechars/dafny0/Char.dfy | 28 ++++------------- .../expectations/Expect.dfy.expect | 10 +++---- .../expectations/ExpectWithMessage.dfy | 10 +++---- .../expectations/ExpectWithMessage.dfy.expect | 3 ++ 9 files changed, 49 insertions(+), 49 deletions(-) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Char.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Char.dfy index 14b52ecbac0..29d2cbcf205 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Char.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Char.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- +// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --allow-deprecation class CharChar { @@ -43,7 +43,7 @@ class CharChar { method CharEq(s: string) { if "hello Dafny" <= s { assert s[6] == 'D'; - assert s[7] == '\u0061'; + assert s[7] == '\U{61}'; if * { assert s[9] == '\n'; // error } else if * { @@ -78,7 +78,7 @@ ghost function toLower(ch: char): char ghost function BadToLower_Overflow(ch: char): char { if 'A' <= ch then - ch - 'A' + 'a' // error: possible overvlow + ch - 'A' + 'a' // error: possible overflow else ch } @@ -86,16 +86,32 @@ ghost function BadToLower_Overflow(ch: char): char ghost function BadToLower_Underflow(ch: char): char { if ch <= 'Z' then - ch - 'A' + 'a' // error: possible overvlow + ch - 'A' + 'a' // error: possible underflow + else + ch +} + +ghost function BadToLower_OverflowIntoSurrogateRange(ch: char): char +{ + if 'A' <= ch <= '\U{D7FF}' then + ch - 'A' + 'a' // error: possible overflow + else + ch +} + +ghost function BadToLower_UnderflowIntoSurrogateRange(ch: char): char +{ + if '\U{E000}' <= ch <= '\U{1_0000}' then + ch - 'A' + 'a' // error: possible underflow else ch } lemma AboutChar(ch: char, dh: char) - requires 'r' < dh < '\uabcd' + requires 'r' < dh < '\U{abcd}' ensures ch == ch + '\0' == ch - '\0' - ensures dh - '\u0020' < dh - ensures dh + '\u0020' > dh + ensures dh - '\U{20}' < dh + ensures dh + '\U{20}' > dh ensures '\n' + dh == dh + '\n' { } diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/Expect.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/Expect.dfy.expect index e3dc95e1cb0..57fd8ded85f 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/Expect.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/Expect.dfy.expect @@ -1,15 +1,15 @@ -Dafny program verifier finished with 0 verified, 0 errors +Dafny program verifier finished with 1 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation -Dafny program verifier finished with 0 verified, 0 errors +Dafny program verifier finished with 1 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation -Dafny program verifier finished with 0 verified, 0 errors +Dafny program verifier finished with 1 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation -Dafny program verifier finished with 0 verified, 0 errors +Dafny program verifier finished with 1 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation -Dafny program verifier finished with 0 verified, 0 errors +Dafny program verifier finished with 1 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithMessage.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithMessage.dfy.expect index 473ffe58c68..39cc58df1ca 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithMessage.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectWithMessage.dfy.expect @@ -10,6 +10,3 @@ Dafny program verifier finished with 0 verified, 0 errors Dafny program verifier finished with 0 verified, 0 errors [Program halted] ExpectWithMessage.dfy(8,2): Down with Doublethink! - -Dafny program verifier finished with 0 verified, 0 errors -[Program halted] ExpectWithMessage.dfy(8,2): Down with Doublethink! diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5238.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5238.dfy index d8cad9a8676..43192682058 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5238.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-5238.dfy @@ -1,5 +1,5 @@ // RUN: %testDafnyForEachCompiler "%s" -// RUN: %testDafnyForEachCompiler "%s" -- --unicode-char=false +// RUN: %testDafnyForEachCompiler "%s" -- --allow-deprecation --unicode-char=false method Main() { var s: seq; diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy index 3293ce6bedc..1d1361ddb1f 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy @@ -1,3 +1,3 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4174 -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --unicode-char false --verify-included-files -verify-included-files +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --allow-deprecation --relax-definite-assignment --unicode-char false --verify-included-files include "../../comp/Numbers.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/dafny0/Char.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/dafny0/Char.dfy index c7c16ae765d..9f9ddf41853 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/dafny0/Char.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/dafny0/Char.dfy @@ -43,7 +43,7 @@ class CharChar { method CharEq(s: string) { if "hello Dafny" <= s { assert s[6] == 'D'; - assert s[7] == '\U{61}'; + assert s[7] == '\u0061'; if * { assert s[9] == '\n'; // error } else if * { @@ -78,7 +78,7 @@ ghost function toLower(ch: char): char ghost function BadToLower_Overflow(ch: char): char { if 'A' <= ch then - ch - 'A' + 'a' // error: possible overflow + ch - 'A' + 'a' // error: possible overvlow else ch } @@ -86,32 +86,16 @@ ghost function BadToLower_Overflow(ch: char): char ghost function BadToLower_Underflow(ch: char): char { if ch <= 'Z' then - ch - 'A' + 'a' // error: possible underflow - else - ch -} - -ghost function BadToLower_OverflowIntoSurrogateRange(ch: char): char -{ - if 'A' <= ch <= '\U{D7FF}' then - ch - 'A' + 'a' // error: possible overflow - else - ch -} - -ghost function BadToLower_UnderflowIntoSurrogateRange(ch: char): char -{ - if '\U{E000}' <= ch <= '\U{1_0000}' then - ch - 'A' + 'a' // error: possible underflow + ch - 'A' + 'a' // error: possible overvlow else ch } lemma AboutChar(ch: char, dh: char) - requires 'r' < dh < '\U{abcd}' + requires 'r' < dh < '\uabcd' ensures ch == ch + '\0' == ch - '\0' - ensures dh - '\U{20}' < dh - ensures dh + '\U{20}' > dh + ensures dh - '\u0020' < dh + ensures dh + '\u0020' > dh ensures '\n' + dh == dh + '\n' { } diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/Expect.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/Expect.dfy.expect index 57fd8ded85f..e3dc95e1cb0 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/Expect.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/Expect.dfy.expect @@ -1,15 +1,15 @@ -Dafny program verifier finished with 1 verified, 0 errors +Dafny program verifier finished with 0 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation -Dafny program verifier finished with 1 verified, 0 errors +Dafny program verifier finished with 0 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation -Dafny program verifier finished with 1 verified, 0 errors +Dafny program verifier finished with 0 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation -Dafny program verifier finished with 1 verified, 0 errors +Dafny program verifier finished with 0 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation -Dafny program verifier finished with 1 verified, 0 errors +Dafny program verifier finished with 0 verified, 0 errors [Program halted] Expect.dfy(22,2): expectation violation diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy index f705729579b..ecd4db993e8 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy @@ -1,7 +1,7 @@ -// RUN: ! %run --target cs --allow-deprecation --unicode-char "%s" > "%t" -// RUN: ! %run --target go --allow-deprecation --unicode-char "%s" >> "%t" -// RUN: ! %run --target java --allow-deprecation --unicode-char "%s" >> "%t" -// RUN: ! %run --target js --allow-deprecation --unicode-char "%s" >> "%t" -// RUN: ! %run --target py --allow-deprecation --unicode-char "%s" >> "%t" +// RUN: ! %run --target cs --allow-deprecation --unicode-char false "%s" > "%t" +// RUN: ! %run --target go --allow-deprecation --unicode-char false "%s" >> "%t" +// RUN: ! %run --target java --allow-deprecation --unicode-char false "%s" >> "%t" +// RUN: ! %run --target js --allow-deprecation --unicode-char false "%s" >> "%t" +// RUN: ! %run --target py --allow-deprecation --unicode-char false "%s" >> "%t" // RUN: %diff "%s.expect" "%t" include "../../expectations/ExpectWithMessage.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy.expect index 39cc58df1ca..473ffe58c68 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy.expect @@ -10,3 +10,6 @@ Dafny program verifier finished with 0 verified, 0 errors Dafny program verifier finished with 0 verified, 0 errors [Program halted] ExpectWithMessage.dfy(8,2): Down with Doublethink! + +Dafny program verifier finished with 0 verified, 0 errors +[Program halted] ExpectWithMessage.dfy(8,2): Down with Doublethink! From 3dd25c7debb19e1ccacf02adb199b9d44e1e7014 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Wed, 10 Apr 2024 12:31:45 +0200 Subject: [PATCH 12/26] Fix ExternDafnyString --- .../TestFiles/LitTests/LitTest/comp/Conversions.java | 4 ++-- .../TestFiles/LitTests/LitTest/comp/ExternDafnyString.java | 6 +++--- .../LitTests/LitTest/unicodechars/comp/Conversions.java | 4 ++-- .../LitTest/unicodechars/comp/ExternDafnyString.java | 5 +++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Conversions.java b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Conversions.java index 84fe6fd45f3..45c5c97e58d 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Conversions.java +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Conversions.java @@ -1,7 +1,7 @@ package Util; public class Conversions { - public static String ToJavaString(dafny.DafnySequence s) { + public static String ToJavaString(dafny.DafnySequence s) { return s.verbatimString(); } -} +} \ No newline at end of file diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternDafnyString.java b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternDafnyString.java index 8539d7d2f01..eba00949847 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternDafnyString.java +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternDafnyString.java @@ -1,10 +1,10 @@ package dafny; public class ExternDafnyString { - public static dafny.DafnySequence getStringFromFile() { + public static dafny.DafnySequence getStringFromFile() { // Let's pretend the following is read from a file: String js = "this is some possible / text that / may have come from a file"; // Convert this Java string to a Dafny string before returning: - return dafny.DafnySequence.asString(js); + return dafny.DafnySequence.asUnicodeString(js); } -} +} \ No newline at end of file diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Conversions.java b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Conversions.java index d79d930f94f..9d5ea2fb007 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Conversions.java +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Conversions.java @@ -1,7 +1,7 @@ package Util; public class Conversions { - public static String ToJavaString(dafny.DafnySequence s) { + public static String ToJavaString(dafny.DafnySequence s) { return s.verbatimString(); } -} +} \ No newline at end of file diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternDafnyString.java b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternDafnyString.java index 01cba068068..58f820cbe39 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternDafnyString.java +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternDafnyString.java @@ -1,10 +1,11 @@ + package dafny; public class ExternDafnyString { - public static dafny.DafnySequence getStringFromFile() { + public static dafny.DafnySequence getStringFromFile() { // Let's pretend the following is read from a file: String js = "this is some possible / text that / may have come from a file"; // Convert this Java string to a Dafny string before returning: - return dafny.DafnySequence.asUnicodeString(js); + return dafny.DafnySequence.asString(js); } } From 92a8e88a6649b7a4bbfa73685551958c2b29b789 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Wed, 10 Apr 2024 12:33:55 +0200 Subject: [PATCH 13/26] Test fixes --- .../ExpectAndExceptions.dfy.expect | 11 ++++------- .../expectations/ExpectAndExceptions.dfy | 10 +++++----- .../ExpectAndExceptions.dfy.expect | 19 +++++++++++-------- .../ExpectWithNonStringMessage.dfy | 10 +++++----- .../ExpectWithNonStringMessage.dfy.expect | 12 +++++------- 5 files changed, 30 insertions(+), 32 deletions(-) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectAndExceptions.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectAndExceptions.dfy.expect index b9bf0494151..572284717d0 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectAndExceptions.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/expectations/ExpectAndExceptions.dfy.expect @@ -1,15 +1,12 @@ -Dafny program verifier finished with 0 verified, 0 errors +Dafny program verifier finished with 2 verified, 0 errors [Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") -Dafny program verifier finished with 0 verified, 0 errors +Dafny program verifier finished with 2 verified, 0 errors [Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") -Dafny program verifier finished with 0 verified, 0 errors +Dafny program verifier finished with 2 verified, 0 errors [Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") -Dafny program verifier finished with 0 verified, 0 errors -[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") - -Dafny program verifier finished with 0 verified, 0 errors +Dafny program verifier finished with 2 verified, 0 errors [Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy index 3cf323d8382..323211c0047 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy @@ -1,7 +1,7 @@ -// RUN: ! %run --target cs --allow-deprecation --unicode-char "%s" > "%t" -// RUN: ! %run --target go --allow-deprecation --unicode-char "%s" >> "%t" -// RUN: ! %run --target java --allow-deprecation --unicode-char "%s" >> "%t" -// RUN: ! %run --target js --allow-deprecation --unicode-char "%s" >> "%t" -// RUN: ! %run --target py --allow-deprecation --unicode-char "%s" >> "%t" +// RUN: ! %run --target cs --allow-deprecation --unicode-char false "%s" > "%t" +// RUN: ! %run --target go --allow-deprecation --unicode-char false "%s" >> "%t" +// RUN: ! %run --target java --allow-deprecation --unicode-char false "%s" >> "%t" +// RUN: ! %run --target js --allow-deprecation --unicode-char false "%s" >> "%t" +// RUN: ! %run --target py --allow-deprecation --unicode-char false "%s" >> "%t" // RUN: %diff "%s.expect" "%t" include "../../expectations/ExpectAndExceptions.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy.expect index 572284717d0..18fac6636f6 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy.expect @@ -1,12 +1,15 @@ -Dafny program verifier finished with 2 verified, 0 errors -[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") +Dafny program verifier finished with 0 verified, 0 errors +[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure(Kaboom!) -Dafny program verifier finished with 2 verified, 0 errors -[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") +Dafny program verifier finished with 0 verified, 0 errors +[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure(Kaboom!) -Dafny program verifier finished with 2 verified, 0 errors -[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") +Dafny program verifier finished with 0 verified, 0 errors +[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure(Kaboom!) -Dafny program verifier finished with 2 verified, 0 errors -[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure("Kaboom!") +Dafny program verifier finished with 0 verified, 0 errors +[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure(Kaboom!) + +Dafny program verifier finished with 0 verified, 0 errors +[Program halted] ExpectAndExceptions.dfy(17,22): NatOutcome.NatFailure(Kaboom!) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy index f000ae418b7..6dbbe0bae6d 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy @@ -1,9 +1,9 @@ -// RUN: %verify --verify-included-files --allow-deprecation --unicode-char "%s" > "%t" -// RUN: ! %run --no-verify --target cs --allow-deprecation --unicode-char "%s" >> "%t" -// RUN: ! %run --no-verify --target go --allow-deprecation --unicode-char "%s" >> "%t" -// RUN: ! %run --no-verify --target java --allow-deprecation --unicode-char "%s" >> "%t" +// RUN: %verify --verify-included-files --allow-deprecation --unicode-char false "%s" > "%t" +// RUN: ! %run --no-verify --target cs --allow-deprecation --unicode-char false "%s" >> "%t" +// RUN: ! %run --no-verify --target go --allow-deprecation --unicode-char false "%s" >> "%t" +// RUN: ! %run --no-verify --target java --allow-deprecation --unicode-char false "%s" >> "%t" // RUN: ! %run --no-verify --target js "--allow-deprecation --unicode-char %s" >> "%t" -// RUN: ! %run --no-verify --target py --allow-deprecation --unicode-char "%s" >> "%t" +// RUN: ! %run --no-verify --target py --allow-deprecation --unicode-char false "%s" >> "%t" // RUN: %diff "%s.expect" "%t" // Note this is one good example of printing regressing with /unicodeChar:1 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy.expect index f33401eab87..ab79f6b054c 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy.expect @@ -2,16 +2,14 @@ Dafny program verifier finished with 0 verified, 0 errors Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(where over the rainbow) Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(where over the rainbow) Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(where over the rainbow) +CLI: Error: file ExpectWithNonStringMessage.dfy not found Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") - -Dafny program verifier did not attempt verification -[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some("where over the rainbow") +[Program halted] ExpectWithNonStringMessage.dfy(13,2): Option.Some(where over the rainbow) From 1402c5e4076dc9e8c835d1aee1b358c848bf1f0e Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Wed, 10 Apr 2024 12:41:17 +0200 Subject: [PATCH 14/26] Fix tests --- .../LitTests/LitTest/dafny0/Strings.dfy | 2 +- .../LitTests/LitTest/dafny0/Termination.dfy | 2 +- .../LitTest/dafny0/Termination.dfy.expect | 1 - .../dafny0/Termination.dfy.refresh.expect | 1 - .../LitTest/git-issues/github-issue-2928.dfy | 19 +++++++++++++++++-- .../git-issues/github-issue-2928.dfy | 2 +- 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Strings.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Strings.dfy index 5823c49a0c6..b1b2260ec8c 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Strings.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Strings.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --unicode-char=false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --allow-deprecation --unicode-char=false method Char(a: char, s: string, i: int) returns (b: char) { diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Termination.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Termination.dfy index 331c1252809..8ac6f9a37ae 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Termination.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Termination.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --relax-definite-assignment --unicode-char=false +// RUN: %testDafnyForEachResolver --expect-exit-code=4 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char=false class Termination { diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Termination.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Termination.dfy.expect index 0230b318658..0d2842886fd 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Termination.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Termination.dfy.expect @@ -1,4 +1,3 @@ -Termination.dfy(450,7): Warning: the ... refinement feature in statements is deprecated Termination.dfy(108,2): Error: cannot prove termination; try supplying a decreases clause for the loop Termination.dfy(125,2): Error: decreases expression might not decrease Termination.dfy(126,16): Error: decreases expression must be bounded below by 0 at end of loop iteration diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Termination.dfy.refresh.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Termination.dfy.refresh.expect index 7cc2944f0b5..65c547aff38 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Termination.dfy.refresh.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/Termination.dfy.refresh.expect @@ -1,4 +1,3 @@ -Termination.dfy(450,7): Warning: the ... refinement feature in statements is deprecated Termination.dfy(108,2): Error: cannot prove termination; try supplying a decreases clause for the loop Termination.dfy(125,2): Error: decreases expression might not decrease Termination.dfy(126,16): Error: decreases expression must be bounded below by 0 at end of loop iteration diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2928.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2928.dfy index 6d4963ae7ab..63c833648d4 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2928.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/github-issue-2928.dfy @@ -1,3 +1,18 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --unicode-char +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- -include "../../git-issues/github-issue-2928.dfy" +method Main() { + var c := '\0'; + assert c == 0 as char; + expect c == 0 as char; + + var s := "\03"; + + assert |s| == 2; + expect |s| == 2; + + assert s[0] == 0 as char; + expect s[0] == 0 as char; + + assert s[1] == '3'; + expect s[1] == '3'; +} diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/git-issues/github-issue-2928.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/git-issues/github-issue-2928.dfy index 6d4963ae7ab..7b0144f7e4e 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/git-issues/github-issue-2928.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/git-issues/github-issue-2928.dfy @@ -1,3 +1,3 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --unicode-char +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --allow-deprecation --unicode-char false include "../../git-issues/github-issue-2928.dfy" From bf383c463cc64e16e2fe2ff11c1f154bc0a7ae27 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Wed, 10 Apr 2024 14:28:45 +0200 Subject: [PATCH 15/26] Fixes --- .../LitTests/LitTest/unicodechars/comp/Collections.dfy | 2 +- docs/check-examples | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy index f9ba73046bf..5ce4e25b71c 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy @@ -1,3 +1,3 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4108 -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --verify-included-files +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char false --spill-translation --verify-included-files include "../../comp/Collections.dfy" diff --git a/docs/check-examples b/docs/check-examples index e43a9acb198..5096728128d 100755 --- a/docs/check-examples +++ b/docs/check-examples @@ -121,7 +121,7 @@ outdir="$dir/../Test/docexamples" coverage=0 permOptions="--show-snippets:false " -defOptions="--function-syntax:4 --use-basename-for-filename --unicode-char:false" +defOptions="--function-syntax:4 --use-basename-for-filename" legacyOptions="-functionSyntax:4 -useBaseNameForFileName -showSnippets:0" while getopts 'c' opt; do From 2fe991d9a8edf779bcb1aa6f923bb8df7b6851f1 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Wed, 10 Apr 2024 14:29:20 +0200 Subject: [PATCH 16/26] Update refman --- docs/DafnyRef/Options.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/DafnyRef/Options.txt b/docs/DafnyRef/Options.txt index b5d88209010..3e146a075d8 100644 --- a/docs/DafnyRef/Options.txt +++ b/docs/DafnyRef/Options.txt @@ -87,10 +87,6 @@ Usage: dafny [ option ... ] [ filename ... ] See https://github.com/dafny-lang/dafny/blob/master/Source/DafnyStandardLibraries/README.md for more information. Not compatible with the /unicodeChar:0 option. - /unicodeChar: - 0 - The char type represents any UTF-16 code unit. - 1 (default) - The char type represents any Unicode scalar value. - /noIncludes Ignore include directives. From 607c79cda9020397c033bf2d65e3d1d8b745b7ba Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 12 Apr 2024 11:22:56 +0200 Subject: [PATCH 17/26] Let TestGeneration CLI tests use unicode-char=true --- .../TestGenerationNoInliningEnumerativeDefinitions.dfy | 4 ++-- .../TestGenerationWithInliningQuantifiedDefinitions.dfy | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationNoInliningEnumerativeDefinitions.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationNoInliningEnumerativeDefinitions.dfy index 819f3a24956..b97f6ac832b 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationNoInliningEnumerativeDefinitions.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationNoInliningEnumerativeDefinitions.dfy @@ -1,11 +1,11 @@ // Generating and Running Block-Based Tests: // RUN: %baredafny generate-tests %args Block %S/TestGenerationNoInliningEnumerativeDefinitions.dfy > %t-tests.dfy -// RUN: %baredafny test %args --allow-deprecation --unicode-char false --target:cs "%t-tests.dfy" >> "%t" +// RUN: %baredafny test %args --target:cs "%t-tests.dfy" >> "%t" // Generating and Running Path-Based Tests: // RUN: %baredafny generate-tests %args Path %S/TestGenerationNoInliningEnumerativeDefinitions.dfy > %t-tests.dfy -// RUN: %baredafny test %args --allow-deprecation --unicode-char false --target:cs "%t-tests.dfy" >> "%t" +// RUN: %baredafny test %args --target:cs "%t-tests.dfy" >> "%t" // RUN: %OutputCheck --file-to-check "%t" "%s" // CHECK: .*Dafny program verifier finished with 2 verified, 0 errors* diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationWithInliningQuantifiedDefinitions.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationWithInliningQuantifiedDefinitions.dfy index ce17619f9e1..49295d90922 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationWithInliningQuantifiedDefinitions.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/blogposts/TestGenerationWithInliningQuantifiedDefinitions.dfy @@ -1,6 +1,6 @@ // Generating and Running Path-Based Tests: // RUN: %baredafny generate-tests %args Path %S/TestGenerationWithInliningQuantifiedDefinitions.dfy > %t-tests.dfy -// RUN: %baredafny test %args --allow-deprecation --unicode-char false --target:cs "%t-tests.dfy" >> "%t" +// RUN: %baredafny test %args --target:cs "%t-tests.dfy" >> "%t" // RUN: %OutputCheck --file-to-check "%t" "%s" // CHECK: .*Dafny program verifier finished with 5 verified, 0 errors* From aef2aafd7fe4f3cd1eaa27718c2ddcfdfb98602a Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 12 Apr 2024 11:28:53 +0200 Subject: [PATCH 18/26] Remove unicode-char deprecated warning when using c++ back-end --- Source/DafnyCore/Options/CommonOptionBag.cs | 2 +- Source/DafnyDriver/CliCompilation.cs | 3 ++- .../TestFiles/LitTests/LitTest/c++/extern.dfy | 2 +- .../TestFiles/LitTests/LitTest/c++/functions.dfy | 2 +- .../IntegrationTests/TestFiles/LitTests/LitTest/c++/tuple.dfy | 2 +- .../LitTest/comp/compile1verbose/CompileAndThenRun.dfy | 2 +- .../TestFiles/LitTests/LitTest/comp/compile3/JustRun.dfy | 4 ++-- .../LitTests/LitTest/git-issues/git-issue-1151-more.dfy | 2 +- 8 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Source/DafnyCore/Options/CommonOptionBag.cs b/Source/DafnyCore/Options/CommonOptionBag.cs index 1974fea0912..f461a222ec1 100644 --- a/Source/DafnyCore/Options/CommonOptionBag.cs +++ b/Source/DafnyCore/Options/CommonOptionBag.cs @@ -184,7 +184,7 @@ Note that quantifier variable domains (<- ) are available in both syntax js - Compile to JavaScript. java - Compile to Java. py - Compile to Python. -cpp - Compile to C++. +cpp - (experimental) Compile to C++. Note that the C++ backend has various limitations (see Docs/Compilation/Cpp.md). This includes lack of support for BigIntegers (aka int), most higher order functions, and advanced features like traits or co-inductive types.".TrimStart() ) { diff --git a/Source/DafnyDriver/CliCompilation.cs b/Source/DafnyDriver/CliCompilation.cs index f699909eee8..44c52ddee71 100644 --- a/Source/DafnyDriver/CliCompilation.cs +++ b/Source/DafnyDriver/CliCompilation.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using Microsoft.Boogie; using Microsoft.Dafny; +using Microsoft.Dafny.Compilers; using Microsoft.Dafny.LanguageServer.Language; using Microsoft.Dafny.LanguageServer.Language.Symbols; using Microsoft.Dafny.LanguageServer.Workspace; @@ -152,7 +153,7 @@ public void Start() { public bool VerifiedAssertions { get; private set; } public async IAsyncEnumerable VerifyAllLazily(int? randomSeed) { - if (!Options.Get(CommonOptionBag.UnicodeCharacters)) { + if (!Options.Get(CommonOptionBag.UnicodeCharacters) && Options.Backend is not CppBackend) { Compilation.Reporter.Deprecated(MessageSource.Verifier, "unicodeCharDeprecated", Token.Cli, "the option unicode-char has been deprecated."); } diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/extern.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/extern.dfy index 0eaec93f859..d3207091368 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/extern.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/extern.dfy @@ -1,4 +1,4 @@ -// RUN: %run --target cpp --allow-deprecation --unicode-char false "%s" --input ExternDefs.h > "%t" +// RUN: %run --target cpp --unicode-char false "%s" --input ExternDefs.h > "%t" // RUN: %diff "%s.expect" "%t" module {:extern "Extern"} Extern { diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/functions.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/functions.dfy index c3a166b2cff..a5a0c657210 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/functions.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/functions.dfy @@ -1,4 +1,4 @@ -// RUN: %run --target cpp --allow-deprecation --unicode-char false "%s" --input ExternDefs.h > "%t" +// RUN: %run --target cpp --unicode-char false "%s" --input ExternDefs.h > "%t" // RUN: %diff "%s.expect" "%t" module {:extern "Extern"} Extern { diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/tuple.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/tuple.dfy index 829139e4106..9f2997cfaa9 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/tuple.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/c++/tuple.dfy @@ -1,4 +1,4 @@ -// RUN: %run --target cpp --allow-deprecation --unicode-char false --input ExternDefs.h "%s" > "%t" +// RUN: %run --target cpp --unicode-char false --input ExternDefs.h "%s" > "%t" // RUN: %diff "%s.expect" "%t" newtype uint32 = i:int | 0 <= i < 0x100000000 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1verbose/CompileAndThenRun.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1verbose/CompileAndThenRun.dfy index 134ba7d0456..408d8ad3f8d 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1verbose/CompileAndThenRun.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1verbose/CompileAndThenRun.dfy @@ -10,7 +10,7 @@ // RUN: %build --verbose --target java "%s" >> "%t" // RUN: java -cp %binaryDir/DafnyRuntime.jar%{pathsep}%S/CompileAndThenRun.jar CompileAndThenRun >> "%t" -// RUN: %build --allow-deprecation --unicode-char false --verbose --target cpp "%s" >> "%t" +// RUN: %build --unicode-char false --verbose --target cpp "%s" >> "%t" // RUN: %S/CompileAndThenRun.exe >> "%t" // RUN: %build --verbose --target py "%s" >> "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile3/JustRun.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile3/JustRun.dfy index 0dbb31608cc..b0413d4c0e3 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile3/JustRun.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile3/JustRun.dfy @@ -4,13 +4,13 @@ // RUN: %run --target js --verbose "%s" >> "%t" // RUN: %run --target go --verbose "%s" >> "%t" // RUN: %run --target java --verbose "%s" >> "%t" -// RUN: %run --target cpp --allow-deprecation --unicode-char false --verbose "%s" >> "%t" +// RUN: %run --target cpp --unicode-char false --verbose "%s" >> "%t" // RUN: %run --target py --verbose "%s" >> "%t" // RUN: %run --target cs "%s" >> "%t" // RUN: %run --target js "%s" >> "%t" // RUN: %run --target go "%s" >> "%t" // RUN: %run --target java "%s" >> "%t" -// RUN: %run --target cpp --allow-deprecation --unicode-char false "%s" >> "%t" +// RUN: %run --target cpp --unicode-char false "%s" >> "%t" // RUN: %run --target py "%s" >> "%t" // RUN: %diff "%s.expect" "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1151-more.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1151-more.dfy index 1199be41d82..ffb2c3ccbd1 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1151-more.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-1151-more.dfy @@ -3,7 +3,7 @@ // RUN: %exits-with 3 %run --no-verify --target java "%s" >> "%t" // RUN: %exits-with 3 %run --no-verify --target js "%s" >> "%t" // RUN: %exits-with 3 %run --no-verify --target go "%s" >> "%t" -// RUN: %exits-with 3 %run --no-verify --allow-deprecation --unicode-char false --target cpp "%s" >> "%t" +// RUN: %exits-with 3 %run --no-verify --unicode-char false --target cpp "%s" >> "%t" // RUN: %exits-with 3 %run --no-verify --target py "%s" >> "%t" // RUN: %diff "%s.expect" "%t" From 4f558ea18c2003e112aaa8f0e14429578db1e619 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Fri, 12 Apr 2024 14:41:39 +0200 Subject: [PATCH 19/26] Fix docs --- docs/HowToFAQ/Errors-Parser.md | 2 +- docs/HowToFAQ/Errors-Parser.template | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/HowToFAQ/Errors-Parser.md b/docs/HowToFAQ/Errors-Parser.md index 0651a097299..cb42bd4d245 100644 --- a/docs/HowToFAQ/Errors-Parser.md +++ b/docs/HowToFAQ/Errors-Parser.md @@ -1265,7 +1265,7 @@ are grouped. The example `5 | 6 & 7` should be written as either `(5 | 6) & 7` o ## **Error: too many characters in character literal** {#p_invalid_char_literal} - + ```dafny const c := '🚀' ``` diff --git a/docs/HowToFAQ/Errors-Parser.template b/docs/HowToFAQ/Errors-Parser.template index bffbed17960..eddfc429932 100644 --- a/docs/HowToFAQ/Errors-Parser.template +++ b/docs/HowToFAQ/Errors-Parser.template @@ -983,7 +983,7 @@ const i: int := 5 | 6 & 7 ## **Error: too many characters in character literal** {#p_invalid_char_literal} - + ```dafny const c := '🚀' ``` From f667d8630149a732e7c56eb770646c44abedf39f Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Tue, 16 Apr 2024 15:17:59 -0700 Subject: [PATCH 20/26] =?UTF-8?q?Remove=20=E2=80=94unicode-char=20false=20?= =?UTF-8?q?from=20as=20many=20tests=20as=20possible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (aside from those in unicodechars and c++) All remaining tests are using —unicode-char as an example for general compatibility testing, or using the C++ backend. The only exception is git-issue-356[-errors].dfy, which could be duplicated for `—unicode-char true` mode, but wouldn’t really add any additional coverage. --- .../LitTest/comp/ErasableTypeWrappers.dfy | 2 +- .../LitTest/comp/ExternJavaString.dfy | 4 +- .../LitTests/LitTest/comp/JsModule.dfy | 4 +- .../TestFiles/LitTests/LitTest/comp/Print.dfy | 10 ++-- .../LitTests/LitTest/comp/Print.dfy.expect | 56 +++++++++---------- .../comp/compile1quiet/CompileRunQuietly.dfy | 12 ++-- .../LitTest/contract-wrappers/AllExterns.dfy | 2 +- .../dafny0/ArrayElementInitCompile.dfy | 2 +- .../dafny0/ArrayElementInitCompile.dfy.expect | 8 +-- .../examples/Simple_compiler/Compiler.dfy | 40 ++++++------- .../Simple_compiler/Compiler.dfy.expect | 6 +- .../examples/Simple_compiler/csharp/Main.cs | 7 ++- .../LitTest/git-issues/git-issue-2733.dfy | 2 +- .../unicodechars/comp/ExternJavaString.dfy | 4 +- .../LitTest/unicodechars/comp/Print.dfy | 7 +++ .../unicodechars/comp/Print.dfy.expect | 42 ++++++++++++++ 16 files changed, 131 insertions(+), 77 deletions(-) create mode 100644 Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Print.dfy create mode 100644 Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Print.dfy.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy index fc5f494d48f..9f2506e8f69 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false --type-system-refresh --general-traits=datatype +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --type-system-refresh --general-traits=datatype datatype SingletonRecord = SingletonRecord(u: int) datatype GhostOrNot = ghost Ghost(a: int, b: int) | Compiled(x: int) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternJavaString.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternJavaString.dfy index 16585c64c99..a051bb27b5c 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternJavaString.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ExternJavaString.dfy @@ -1,4 +1,4 @@ -// RUN: %run --allow-deprecation --unicode-char false --target java "%s" --input %S/Conversions.java --input %S/ExternJavaString.java > "%t" +// RUN: %run --target java "%s" --input %S/Conversions.java --input %S/ExternJavaString.java > "%t" // RUN: %diff "%s.expect" "%t" // In this example, the extern method obtains a Java string and returns it as such. // The Dafny code converts that Java string to a Dafny string. @@ -13,7 +13,7 @@ method {:extern "Util.Conversions", "ToJavaString"} ToJavaString(s: string) retu ensures js.value == s // The conversion this way can be a function. -function {:extern "dafny.DafnySequence", "asString"} ToDafnyString(js: JavaString): string +function {:extern "dafny.DafnySequence", "asUnicodeString"} ToDafnyString(js: JavaString): string ensures ToDafnyString(js) == js.value method {:extern "dafny.ExternJavaString", "getStringFromFile"} GetStringFromFile() returns (js: JavaString) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/JsModule.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/JsModule.dfy index 13fa069f498..3c87d6fd070 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/JsModule.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/JsModule.dfy @@ -1,5 +1,5 @@ // NONUNIFORM: Javascript-specific extern test -// RUN: %run --allow-deprecation --unicode-char false --target js "%s" > "%t" +// RUN: %run --target js "%s" > "%t" // RUN: %diff "%s.expect" "%t" // "url" is a built-in package in node, so it should be accessible to the @@ -10,6 +10,8 @@ module {:extern "url", "url"} URL { var pathname: string var search: string } + // Note that passing a Dafny string directly as a JS string in --unicode-char true mode + // only happens to work here because we only test on an ASCII string! method {:extern "parse"} Parse(address: string, b: bool) returns (u: Url) } diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Print.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Print.dfy index c1df38d639d..1eca3be5df8 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Print.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Print.dfy @@ -1,9 +1,9 @@ // NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4108 and https://github.com/dafny-lang/dafny/issues/2582 -// RUN: %verify --allow-deprecation --unicode-char false --relax-definite-assignment "%s" > "%t" -// RUN: %run --no-verify --allow-deprecation --unicode-char false --target cs "%s" >> "%t" -// RUN: %run --no-verify --allow-deprecation --unicode-char false --target js "%s" >> "%t" -// RUN: %run --no-verify --allow-deprecation --unicode-char false --target go "%s" >> "%t" -// RUN: %run --no-verify --allow-deprecation --unicode-char false --target java "%s" >> "%t" +// RUN: %verify --relax-definite-assignment "%s" > "%t" +// RUN: %run --no-verify --target cs "%s" >> "%t" +// RUN: %run --no-verify --target js "%s" >> "%t" +// RUN: %run --no-verify --target go "%s" >> "%t" +// RUN: %run --no-verify --target java "%s" >> "%t" // RUN: %diff "%s.expect" "%t" // Python salts hashes so they are not deterministic. diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Print.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Print.dfy.expect index c2b186af0ec..d465f809051 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Print.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/Print.dfy.expect @@ -3,40 +3,40 @@ Dafny program verifier finished with 2 verified, 0 errors Dafny program verifier did not attempt verification Strings in collections: - [abc, def] - [[abc, def]] - {def, abc} - [abc, def] - [] - [] - [aaaaa] + [['a', 'b', 'c'], ['d', 'e', 'f']] + [[['a', 'b', 'c'], ['d', 'e', 'f']]] + {['d', 'e', 'f'], ['a', 'b', 'c']} + [['a', 'b', 'c'], ['d', 'e', 'f']] + [[]] + [[]] + [['a', 'a', 'a', 'a', 'a']] Dafny program verifier did not attempt verification Strings in collections: - [abc, def] - [[abc, def]] - {abc, def} - [abc, def] - [] - [] - [aaaaa] + [['a', 'b', 'c'], ['d', 'e', 'f']] + [[['a', 'b', 'c'], ['d', 'e', 'f']]] + {['a', 'b', 'c'], ['d', 'e', 'f']} + [['a', 'b', 'c'], ['d', 'e', 'f']] + [[]] + [[]] + [['a', 'a', 'a', 'a', 'a']] Dafny program verifier did not attempt verification Strings in collections: - [abc, def] - [[abc, def]] - {abc, def} - [abc, def] - [] - [] - [aaaaa] + [['a', 'b', 'c'], ['d', 'e', 'f']] + [[['a', 'b', 'c'], ['d', 'e', 'f']]] + {['a', 'b', 'c'], ['d', 'e', 'f']} + [['a', 'b', 'c'], ['d', 'e', 'f']] + [[]] + [[]] + [['a', 'a', 'a', 'a', 'a']] Dafny program verifier did not attempt verification Strings in collections: - [abc, def] - [[abc, def]] - {abc, def} - [abc, def] - [] - [] - [aaaaa] + [['a', 'b', 'c'], ['d', 'e', 'f']] + [[['a', 'b', 'c'], ['d', 'e', 'f']]] + {['a', 'b', 'c'], ['d', 'e', 'f']} + [['a', 'b', 'c'], ['d', 'e', 'f']] + [[]] + [[]] + [['a', 'a', 'a', 'a', 'a']] diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1quiet/CompileRunQuietly.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1quiet/CompileRunQuietly.dfy index ce77443c7d5..3373b00f3c7 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1quiet/CompileRunQuietly.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1quiet/CompileRunQuietly.dfy @@ -1,19 +1,19 @@ -// RUN: %build --allow-deprecation --unicode-char false --target cs "%s" > "%t" +// RUN: %build --target cs "%s" > "%t" // RUN: dotnet %S/CompileRunQuietly.dll >> "%t" -// RUN: %build --allow-deprecation --unicode-char false --target js "%s" >> "%t" +// RUN: %build --target js "%s" >> "%t" // RUN: node %S/CompileRunQuietly.js >> "%t" -// RUN: %build --allow-deprecation --unicode-char false --target go "%s" >> "%t" +// RUN: %build --target go "%s" >> "%t" // RUN: %S/CompileRunQuietly >> "%t" -// RUN: %build --allow-deprecation --unicode-char false --target java "%s" >> "%t" +// RUN: %build --target java "%s" >> "%t" // RUN: java -cp %binaryDir/DafnyRuntime.jar%{pathsep}%S/CompileRunQuietly.jar CompileRunQuietly >> "%t" -// RUN: %build --allow-deprecation --unicode-char false --target cpp "%s" >> "%t" +// RUN: %build --target cpp "%s" >> "%t" // RUN: %S/CompileRunQuietly.exe >> "%t" -// RUN: %build --allow-deprecation --unicode-char false --target py "%s" >> "%t" +// RUN: %build --target py "%s" >> "%t" // RUN: python3 %S/CompileRunQuietly-py >> "%t" // RUN: %diff "%s.expect" "%t" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/contract-wrappers/AllExterns.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/contract-wrappers/AllExterns.dfy index 44010b3adc2..55faa3168cd 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/contract-wrappers/AllExterns.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/contract-wrappers/AllExterns.dfy @@ -1,4 +1,4 @@ -// RUN: ! %baredafny test %args --allow-deprecation --unicode-char false --allow-warnings --test-assumptions=externs %s %s.externs.cs > %t +// RUN: ! %baredafny test %args --allow-warnings --test-assumptions=externs %s %s.externs.cs > %t // RUN: %diff "%s.expect" "%t" // RUN: %OutputCheck --file-to-check "%S/AllExterns.cs" "%s" // CHECK: .*Foo____dafny__checked\(x\).* diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInitCompile.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInitCompile.dfy index 4024873dbdf..0863d7ff66d 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInitCompile.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInitCompile.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment method Main() { diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInitCompile.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInitCompile.dfy.expect index eaa3e759999..5de85b55180 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInitCompile.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/dafny0/ArrayElementInitCompile.dfy.expect @@ -4,13 +4,13 @@ 2 3 4 5 3 4 5 6 4 5 6 7 -O . O . O . O . O . O . +'O' '.' 'O' '.' 'O' '.' 'O' '.' 'O' '.' 'O' '.' 12 12 12 12 12 12 12 12 12 12 12 12 -D E -y z +'D' 'E' +'y' 'z' 4 3 7 100 75 98 25 -looks like this rocks +['l', 'o', 'o', 'k', 's'] ['l', 'i', 'k', 'e'] ['t', 'h', 'i', 's'] ['r', 'o', 'c', 'k', 's'] -2 -1 0 1 2 3 4 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/examples/Simple_compiler/Compiler.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/examples/Simple_compiler/Compiler.dfy index 8054340133a..8fe4e84487d 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/examples/Simple_compiler/Compiler.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/examples/Simple_compiler/Compiler.dfy @@ -1,5 +1,5 @@ // RUN: cp %S/Simple.g4 %S/csharp/Simple.g4 -// RUN: %translate cs --include-runtime --allow-deprecation --unicode-char false --output:%S/csharp/Compiler.cs "%s" +// RUN: %translate cs --include-runtime --output:%S/csharp/Compiler.cs "%s" // RUN: dotnet run --project %S/csharp/SimpleCompiler.csproj -- %S/example_input.calc > "%t" // RUN: %diff "%s.expect" "%t" @@ -398,22 +398,14 @@ module {:extern "SimpleCompiler.CSharpUtils"} CSharpUtils { // calling the method twice produces equal results). static function {:extern} StringAsDafnyString(s: String): string + + static method {:extern} + DafnyStringAsString(ds: string) returns (s: String) } class ListUtils { static function {:extern} FoldR(f: (A, B) -> B, b0: B, l: List) : B - - static method LinkedListToCList(ll: LinkedList.List) returns (l: List) { - l := new List(); - var it := ll; - while it.Cons? - decreases it - { - l.Add(it.hd); - it := it.tl; - } - } } } @@ -544,8 +536,10 @@ module Translator { /// Alternatively, we could have chosen to expose the stack machine types to C# directly and do the pretty-printing from there. module PrettyPrint { - import opened LinkedList import opened StackMachine + import opened System + import opened CSharpUtils + import opened System.Collections.Generic function prettyPrintNum(n: int, zero: string) : string decreases n < 0, if n < 0 then -n else n @@ -568,10 +562,16 @@ module PrettyPrint { } } - function prettyPrint(p: Prog) : List { - match p { - case Nil => Nil - case Cons(instr, p) => Cons(prettyPrintInstr(instr), prettyPrint(p)) + method prettyPrint(p: Prog) returns (l: System.Collections.Generic.List) { + l := new List(); + var it := p; + while it.Cons? + decreases it + { + var ds := prettyPrintInstr(it.hd); + var s := StringUtils.DafnyStringAsString(ds); + l.Add(s); + it := it.tl; } } } @@ -594,6 +594,7 @@ module {:extern "SimpleCompiler"} Interop { import PrettyPrint import CSharpUtils import Generics = System.Collections.Generic + import System class DafnyCompiler { static method Compile(dAST: DafnyAST.Stmt) returns (dSM: StackMachine.Prog) @@ -619,12 +620,11 @@ module {:extern "SimpleCompiler"} Interop { } static method CompileAndExport(cAST: CSharpAST.Prog) - returns (output: Generics.List) + returns (output: Generics.List) { var translated: DafnyAST.Stmt := Translator.translateProg(cAST); var compiled: StackMachine.Prog := Compile(translated); - var prettyPrinted: LinkedList.List := PrettyPrint.prettyPrint(compiled); - output := CSharpUtils.ListUtils.LinkedListToCList(prettyPrinted); + output := PrettyPrint.prettyPrint(compiled); } } } diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/examples/Simple_compiler/Compiler.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/examples/Simple_compiler/Compiler.dfy.expect index ca294422db7..c6f9eec108e 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/examples/Simple_compiler/Compiler.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/examples/Simple_compiler/Compiler.dfy.expect @@ -4,17 +4,17 @@ cAST = # Step 2: Compile (using Dafny) translated = - DafnyAST.Stmt.Seq(DafnyAST.Stmt.Assign(x, DafnyAST.Expr.Const(3)), DafnyAST.Stmt.Seq(DafnyAST.Stmt.Print(DafnyAST.Expr.Var(x)), DafnyAST.Stmt.Seq(DafnyAST.Stmt.Assign(y, DafnyAST.Expr.Op(DafnyAST.BinOp.Add, DafnyAST.Expr.Var(x), DafnyAST.Expr.Const(0))), DafnyAST.Stmt.Seq(DafnyAST.Stmt.Print(DafnyAST.Expr.Op(DafnyAST.BinOp.Add, DafnyAST.Expr.Var(y), DafnyAST.Expr.Const(1))), DafnyAST.Stmt.Skip)))) + DafnyAST.Stmt.Seq(DafnyAST.Stmt.Assign("x", DafnyAST.Expr.Const(3)), DafnyAST.Stmt.Seq(DafnyAST.Stmt.Print(DafnyAST.Expr.Var("x")), DafnyAST.Stmt.Seq(DafnyAST.Stmt.Assign("y", DafnyAST.Expr.Op(DafnyAST.BinOp.Add, DafnyAST.Expr.Var("x"), DafnyAST.Expr.Const(0))), DafnyAST.Stmt.Seq(DafnyAST.Stmt.Print(DafnyAST.Expr.Op(DafnyAST.BinOp.Add, DafnyAST.Expr.Var("y"), DafnyAST.Expr.Const(1))), DafnyAST.Stmt.Skip)))) interp(translated) = [3, 4] optimized = - DafnyAST.Stmt.Seq(DafnyAST.Stmt.Assign(x, DafnyAST.Expr.Const(3)), DafnyAST.Stmt.Seq(DafnyAST.Stmt.Print(DafnyAST.Expr.Var(x)), DafnyAST.Stmt.Seq(DafnyAST.Stmt.Assign(y, DafnyAST.Expr.Var(x)), DafnyAST.Stmt.Print(DafnyAST.Expr.Op(DafnyAST.BinOp.Add, DafnyAST.Expr.Var(y), DafnyAST.Expr.Const(1)))))) + DafnyAST.Stmt.Seq(DafnyAST.Stmt.Assign("x", DafnyAST.Expr.Const(3)), DafnyAST.Stmt.Seq(DafnyAST.Stmt.Print(DafnyAST.Expr.Var("x")), DafnyAST.Stmt.Seq(DafnyAST.Stmt.Assign("y", DafnyAST.Expr.Var("x")), DafnyAST.Stmt.Print(DafnyAST.Expr.Op(DafnyAST.BinOp.Add, DafnyAST.Expr.Var("y"), DafnyAST.Expr.Const(1)))))) interp(optimized) = [3, 4] compiled = - LinkedList.List.Cons(StackMachine.Instr.PopPrint, LinkedList.List.Cons(StackMachine.Instr.PopAdd, LinkedList.List.Cons(StackMachine.Instr.PushConst(1), LinkedList.List.Cons(StackMachine.Instr.PushVar(y), LinkedList.List.Cons(StackMachine.Instr.PopVar(y), LinkedList.List.Cons(StackMachine.Instr.PushVar(x), LinkedList.List.Cons(StackMachine.Instr.PopPrint, LinkedList.List.Cons(StackMachine.Instr.PushVar(x), LinkedList.List.Cons(StackMachine.Instr.PopVar(x), LinkedList.List.Cons(StackMachine.Instr.PushConst(3), LinkedList.List.Nil)))))))))) + LinkedList.List.Cons(StackMachine.Instr.PopPrint, LinkedList.List.Cons(StackMachine.Instr.PopAdd, LinkedList.List.Cons(StackMachine.Instr.PushConst(1), LinkedList.List.Cons(StackMachine.Instr.PushVar("y"), LinkedList.List.Cons(StackMachine.Instr.PopVar("y"), LinkedList.List.Cons(StackMachine.Instr.PushVar("x"), LinkedList.List.Cons(StackMachine.Instr.PopPrint, LinkedList.List.Cons(StackMachine.Instr.PushVar("x"), LinkedList.List.Cons(StackMachine.Instr.PopVar("x"), LinkedList.List.Cons(StackMachine.Instr.PushConst(3), LinkedList.List.Nil)))))))))) interp(compiled) = [3, 4] diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/examples/Simple_compiler/csharp/Main.cs b/Source/IntegrationTests/TestFiles/LitTests/LitTest/examples/Simple_compiler/csharp/Main.cs index 71eb821ac78..475497d3043 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/examples/Simple_compiler/csharp/Main.cs +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/examples/Simple_compiler/csharp/Main.cs @@ -109,8 +109,11 @@ public override AST VisitVar(SimpleParser.VarContext context) { namespace CSharpUtils { public partial class StringUtils { - public static Dafny.ISequence StringAsDafnyString(String s) { - return Dafny.Sequence.FromString(s); + public static Dafny.ISequence StringAsDafnyString(String s) { + return Dafny.Sequence.UnicodeFromString(s); + } + public static String DafnyStringAsString(Dafny.ISequence ds) { + return ds.ToVerbatimString(false); } } diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-2733.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-2733.dfy index d84e596ef0c..3cb4c39017b 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-2733.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/git-issues/git-issue-2733.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --allow-deprecation --unicode-char false +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment method Main() { print "XYZ"; // Checks that no extra newline is added to the output diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternJavaString.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternJavaString.dfy index a051bb27b5c..16585c64c99 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternJavaString.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternJavaString.dfy @@ -1,4 +1,4 @@ -// RUN: %run --target java "%s" --input %S/Conversions.java --input %S/ExternJavaString.java > "%t" +// RUN: %run --allow-deprecation --unicode-char false --target java "%s" --input %S/Conversions.java --input %S/ExternJavaString.java > "%t" // RUN: %diff "%s.expect" "%t" // In this example, the extern method obtains a Java string and returns it as such. // The Dafny code converts that Java string to a Dafny string. @@ -13,7 +13,7 @@ method {:extern "Util.Conversions", "ToJavaString"} ToJavaString(s: string) retu ensures js.value == s // The conversion this way can be a function. -function {:extern "dafny.DafnySequence", "asUnicodeString"} ToDafnyString(js: JavaString): string +function {:extern "dafny.DafnySequence", "asString"} ToDafnyString(js: JavaString): string ensures ToDafnyString(js) == js.value method {:extern "dafny.ExternJavaString", "getStringFromFile"} GetStringFromFile() returns (js: JavaString) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Print.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Print.dfy new file mode 100644 index 00000000000..6cd59fbb6cb --- /dev/null +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Print.dfy @@ -0,0 +1,7 @@ +// NONUNIFORM: https://github.com/dafny-lang/dafny/issues/4108 and https://github.com/dafny-lang/dafny/issues/2582 +// RUN: %verify --allow-deprecation --unicode-char false --relax-definite-assignment "%s" > "%t" +// RUN: %run --no-verify --allow-deprecation --unicode-char false --target cs "%s" >> "%t" +// RUN: %run --no-verify --allow-deprecation --unicode-char false --target js "%s" >> "%t" +// RUN: %run --no-verify --allow-deprecation --unicode-char false --target go "%s" >> "%t" +// RUN: %run --no-verify --allow-deprecation --unicode-char false --target java "%s" >> "%t" +include "../../comp/Print.dfy" diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Print.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Print.dfy.expect new file mode 100644 index 00000000000..c2b186af0ec --- /dev/null +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Print.dfy.expect @@ -0,0 +1,42 @@ + +Dafny program verifier finished with 2 verified, 0 errors + +Dafny program verifier did not attempt verification +Strings in collections: + [abc, def] + [[abc, def]] + {def, abc} + [abc, def] + [] + [] + [aaaaa] + +Dafny program verifier did not attempt verification +Strings in collections: + [abc, def] + [[abc, def]] + {abc, def} + [abc, def] + [] + [] + [aaaaa] + +Dafny program verifier did not attempt verification +Strings in collections: + [abc, def] + [[abc, def]] + {abc, def} + [abc, def] + [] + [] + [aaaaa] + +Dafny program verifier did not attempt verification +Strings in collections: + [abc, def] + [[abc, def]] + {abc, def} + [abc, def] + [] + [] + [aaaaa] From 77fc8993394d895ea1f57de3e81f7f767c4e9754 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Tue, 16 Apr 2024 16:17:40 -0700 Subject: [PATCH 21/26] Fix tests --- .../LitTests/LitTest/comp/ErasableTypeWrappers.dfy.expect | 6 +++--- .../TestFiles/LitTests/LitTest/comp/JsModule.dfy | 5 ++--- .../LitTest/comp/compile1quiet/CompileRunQuietly.dfy | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy.expect index 1466b3dce90..4d509fa4669 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy.expect @@ -1,4 +1,4 @@ -62 63 (2, 5) (2, 5) 3 +62 63 (2, 5) (2, 5) 3 ['<', 'g', 'e', 'n', '>'] 62 63 5 5 3 5 5 3 1062 1063 1005 1005 1003 @@ -10,13 +10,13 @@ true false true false true false 0 (0, 0) 0 Color.Pink 13 13 13 GenericDouble.GenericDouble(13, 0) 0 13 false - 3.14 2.7 +['<', 'g', 'e', 'n', '>'] 3.14 2.7 18.0 18.0 3.0 false 18.0 4.0 true HasConst.MakeC(4) (4, 4) 4 (4, 4) OptimizationChecks.Ints.Ints(5, 7) OptimizationChecks.Ints.Ints(5, 7) OptimizationChecks.Ints.AnotherIntsWrapper(OptimizationChecks.Ints.Ints(5, 7)) -D D +'D' 'D' 5 5 ConditionsThatDisableTheOptimization.WithTrait.WithTrait(40) 5 5 ConditionsThatDisableTheOptimization.WithCompiledField.WithCompiledField(41) 100 42 diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/JsModule.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/JsModule.dfy index 3c87d6fd070..3a2cb649cbb 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/JsModule.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/JsModule.dfy @@ -1,5 +1,5 @@ // NONUNIFORM: Javascript-specific extern test -// RUN: %run --target js "%s" > "%t" +// RUN: %run --unicode-char false --target js "%s" > "%t" // RUN: %diff "%s.expect" "%t" // "url" is a built-in package in node, so it should be accessible to the @@ -10,8 +10,7 @@ module {:extern "url", "url"} URL { var pathname: string var search: string } - // Note that passing a Dafny string directly as a JS string in --unicode-char true mode - // only happens to work here because we only test on an ASCII string! + // Note that passing a Dafny string directly as a JS string only works in --unicode-char false mode method {:extern "parse"} Parse(address: string, b: bool) returns (u: Url) } diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1quiet/CompileRunQuietly.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1quiet/CompileRunQuietly.dfy index 3373b00f3c7..ba638344b48 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1quiet/CompileRunQuietly.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/compile1quiet/CompileRunQuietly.dfy @@ -10,7 +10,7 @@ // RUN: %build --target java "%s" >> "%t" // RUN: java -cp %binaryDir/DafnyRuntime.jar%{pathsep}%S/CompileRunQuietly.jar CompileRunQuietly >> "%t" -// RUN: %build --target cpp "%s" >> "%t" +// RUN: %build --unicode-char false --target cpp "%s" >> "%t" // RUN: %S/CompileRunQuietly.exe >> "%t" // RUN: %build --target py "%s" >> "%t" From 4f5371c284646b3e5d09cd4106ef68855d1320fd Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Wed, 17 Apr 2024 11:29:47 +0200 Subject: [PATCH 22/26] Rename unicodechar directory to unicodecharFalse --- .../DafnyTests/RunAllTestsOption.dfy | 0 .../DafnyTests/RunAllTestsOption.dfy.expect | 0 .../LitTest/{unicodechars => unicodecharsFalse}/comp/.gitignore | 0 .../LitTest/{unicodechars => unicodecharsFalse}/comp/Arrays.dfy | 0 .../{unicodechars => unicodecharsFalse}/comp/Arrays.dfy.expect | 0 .../{unicodechars => unicodecharsFalse}/comp/Arrays.dfy.go.expect | 0 .../comp/Arrays.dfy.verifier.expect | 0 .../{unicodechars => unicodecharsFalse}/comp/Collections.dfy | 0 .../comp/Collections.dfy.expect | 0 .../comp/Collections.dfy.go.expect | 0 .../comp/Collections.dfy.java.expect | 0 .../comp/Collections.dfy.js.expect | 0 .../comp/Collections.dfy.py.expect | 0 .../comp/CompileWithArguments.dfy | 0 .../comp/CompileWithArguments.dfy.expect | 0 .../{unicodechars => unicodecharsFalse}/comp/Comprehensions.dfy | 0 .../comp/Comprehensions.dfy.expect | 0 .../comp/Comprehensions.dfy.py.expect | 0 .../{unicodechars => unicodecharsFalse}/comp/Conversions.java | 0 .../comp/ExternDafnyString.dfy | 0 .../comp/ExternDafnyString.dfy.expect | 0 .../comp/ExternDafnyString.java | 0 .../{unicodechars => unicodecharsFalse}/comp/ExternJavaString.dfy | 0 .../comp/ExternJavaString.dfy.expect | 0 .../comp/ExternJavaString.java | 0 .../{unicodechars => unicodecharsFalse}/comp/NativeNumbers.dfy | 0 .../comp/NativeNumbers.dfy.expect | 0 .../comp/NativeNumbers.dfy.js.check | 0 .../LitTest/{unicodechars => unicodecharsFalse}/comp/Numbers.dfy | 0 .../{unicodechars => unicodecharsFalse}/comp/Numbers.dfy.expect | 0 .../comp/Numbers.dfy.go.expect | 0 .../comp/Numbers.dfy.py.expect | 0 .../LitTest/{unicodechars => unicodecharsFalse}/comp/Print.dfy | 0 .../{unicodechars => unicodecharsFalse}/comp/Print.dfy.expect | 0 .../LitTest/{unicodechars => unicodecharsFalse}/dafny0/Char.dfy | 0 .../{unicodechars => unicodecharsFalse}/dafny0/Char.dfy.expect | 0 .../{unicodechars => unicodecharsFalse}/expectations/Expect.dfy | 0 .../expectations/Expect.dfy.expect | 0 .../expectations/ExpectAndExceptions.dfy | 0 .../expectations/ExpectAndExceptions.dfy.expect | 0 .../expectations/ExpectWithMessage.dfy | 0 .../expectations/ExpectWithMessage.dfy.expect | 0 .../expectations/ExpectWithNonStringMessage.dfy | 0 .../expectations/ExpectWithNonStringMessage.dfy.expect | 0 .../git-issues/github-issue-2928.dfy | 0 .../git-issues/github-issue-2928.dfy.expect | 0 46 files changed, 0 insertions(+), 0 deletions(-) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/DafnyTests/RunAllTestsOption.dfy (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/DafnyTests/RunAllTestsOption.dfy.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/.gitignore (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Arrays.dfy (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Arrays.dfy.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Arrays.dfy.go.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Arrays.dfy.verifier.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Collections.dfy (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Collections.dfy.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Collections.dfy.go.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Collections.dfy.java.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Collections.dfy.js.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Collections.dfy.py.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/CompileWithArguments.dfy (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/CompileWithArguments.dfy.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Comprehensions.dfy (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Comprehensions.dfy.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Comprehensions.dfy.py.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Conversions.java (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/ExternDafnyString.dfy (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/ExternDafnyString.dfy.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/ExternDafnyString.java (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/ExternJavaString.dfy (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/ExternJavaString.dfy.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/ExternJavaString.java (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/NativeNumbers.dfy (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/NativeNumbers.dfy.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/NativeNumbers.dfy.js.check (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Numbers.dfy (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Numbers.dfy.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Numbers.dfy.go.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Numbers.dfy.py.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Print.dfy (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/comp/Print.dfy.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/dafny0/Char.dfy (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/dafny0/Char.dfy.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/expectations/Expect.dfy (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/expectations/Expect.dfy.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/expectations/ExpectAndExceptions.dfy (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/expectations/ExpectAndExceptions.dfy.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/expectations/ExpectWithMessage.dfy (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/expectations/ExpectWithMessage.dfy.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/expectations/ExpectWithNonStringMessage.dfy (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/expectations/ExpectWithNonStringMessage.dfy.expect (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/git-issues/github-issue-2928.dfy (100%) rename Source/IntegrationTests/TestFiles/LitTests/LitTest/{unicodechars => unicodecharsFalse}/git-issues/github-issue-2928.dfy.expect (100%) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/DafnyTests/RunAllTestsOption.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/DafnyTests/RunAllTestsOption.dfy similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/DafnyTests/RunAllTestsOption.dfy rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/DafnyTests/RunAllTestsOption.dfy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/DafnyTests/RunAllTestsOption.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/DafnyTests/RunAllTestsOption.dfy.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/DafnyTests/RunAllTestsOption.dfy.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/DafnyTests/RunAllTestsOption.dfy.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/.gitignore b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/.gitignore similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/.gitignore rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/.gitignore diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Arrays.dfy similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Arrays.dfy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Arrays.dfy.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Arrays.dfy.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.go.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Arrays.dfy.go.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.go.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Arrays.dfy.go.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.verifier.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Arrays.dfy.verifier.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Arrays.dfy.verifier.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Arrays.dfy.verifier.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Collections.dfy similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Collections.dfy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Collections.dfy.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Collections.dfy.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.go.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Collections.dfy.go.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.go.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Collections.dfy.go.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.java.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Collections.dfy.java.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.java.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Collections.dfy.java.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.js.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Collections.dfy.js.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.js.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Collections.dfy.js.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.py.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Collections.dfy.py.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Collections.dfy.py.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Collections.dfy.py.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/CompileWithArguments.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/CompileWithArguments.dfy similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/CompileWithArguments.dfy rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/CompileWithArguments.dfy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/CompileWithArguments.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/CompileWithArguments.dfy.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/CompileWithArguments.dfy.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/CompileWithArguments.dfy.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Comprehensions.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Comprehensions.dfy similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Comprehensions.dfy rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Comprehensions.dfy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Comprehensions.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Comprehensions.dfy.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Comprehensions.dfy.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Comprehensions.dfy.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Comprehensions.dfy.py.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Comprehensions.dfy.py.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Comprehensions.dfy.py.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Comprehensions.dfy.py.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Conversions.java b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Conversions.java similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Conversions.java rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Conversions.java diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternDafnyString.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/ExternDafnyString.dfy similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternDafnyString.dfy rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/ExternDafnyString.dfy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternDafnyString.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/ExternDafnyString.dfy.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternDafnyString.dfy.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/ExternDafnyString.dfy.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternDafnyString.java b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/ExternDafnyString.java similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternDafnyString.java rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/ExternDafnyString.java diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternJavaString.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/ExternJavaString.dfy similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternJavaString.dfy rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/ExternJavaString.dfy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternJavaString.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/ExternJavaString.dfy.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternJavaString.dfy.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/ExternJavaString.dfy.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternJavaString.java b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/ExternJavaString.java similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/ExternJavaString.java rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/ExternJavaString.java diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/NativeNumbers.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/NativeNumbers.dfy similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/NativeNumbers.dfy rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/NativeNumbers.dfy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/NativeNumbers.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/NativeNumbers.dfy.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/NativeNumbers.dfy.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/NativeNumbers.dfy.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/NativeNumbers.dfy.js.check b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/NativeNumbers.dfy.js.check similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/NativeNumbers.dfy.js.check rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/NativeNumbers.dfy.js.check diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Numbers.dfy similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Numbers.dfy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Numbers.dfy.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Numbers.dfy.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy.go.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Numbers.dfy.go.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy.go.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Numbers.dfy.go.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy.py.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Numbers.dfy.py.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Numbers.dfy.py.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Numbers.dfy.py.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Print.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Print.dfy similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Print.dfy rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Print.dfy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Print.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Print.dfy.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/comp/Print.dfy.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/comp/Print.dfy.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/dafny0/Char.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/dafny0/Char.dfy similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/dafny0/Char.dfy rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/dafny0/Char.dfy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/dafny0/Char.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/dafny0/Char.dfy.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/dafny0/Char.dfy.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/dafny0/Char.dfy.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/Expect.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/expectations/Expect.dfy similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/Expect.dfy rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/expectations/Expect.dfy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/Expect.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/expectations/Expect.dfy.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/Expect.dfy.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/expectations/Expect.dfy.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/expectations/ExpectAndExceptions.dfy similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/expectations/ExpectAndExceptions.dfy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/expectations/ExpectAndExceptions.dfy.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectAndExceptions.dfy.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/expectations/ExpectAndExceptions.dfy.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/expectations/ExpectWithMessage.dfy similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/expectations/ExpectWithMessage.dfy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/expectations/ExpectWithMessage.dfy.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithMessage.dfy.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/expectations/ExpectWithMessage.dfy.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/expectations/ExpectWithNonStringMessage.dfy similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/expectations/ExpectWithNonStringMessage.dfy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/expectations/ExpectWithNonStringMessage.dfy.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/expectations/ExpectWithNonStringMessage.dfy.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/expectations/ExpectWithNonStringMessage.dfy.expect diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/git-issues/github-issue-2928.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/git-issues/github-issue-2928.dfy similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/git-issues/github-issue-2928.dfy rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/git-issues/github-issue-2928.dfy diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/git-issues/github-issue-2928.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/git-issues/github-issue-2928.dfy.expect similarity index 100% rename from Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodechars/git-issues/github-issue-2928.dfy.expect rename to Source/IntegrationTests/TestFiles/LitTests/LitTest/unicodecharsFalse/git-issues/github-issue-2928.dfy.expect From 1d60806917d59a87f8f73de1fbcac779ca73ffb4 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Wed, 17 Apr 2024 11:33:35 +0200 Subject: [PATCH 23/26] Remove code that might not be needed any more --- .../Legacy/SynchronousCliCompilation.cs | 3 +- Source/TestDafny/MultiBackendTest.cs | 38 +------------------ 2 files changed, 3 insertions(+), 38 deletions(-) diff --git a/Source/DafnyDriver/Legacy/SynchronousCliCompilation.cs b/Source/DafnyDriver/Legacy/SynchronousCliCompilation.cs index 01aa430ab00..d437630fe6c 100644 --- a/Source/DafnyDriver/Legacy/SynchronousCliCompilation.cs +++ b/Source/DafnyDriver/Legacy/SynchronousCliCompilation.cs @@ -714,7 +714,8 @@ public static async Task CompileDafnyProgram(Program dafnyProgram, string } // compile the program into an assembly - var (compiledCorrectly, compilationResult) = await compiler.CompileTargetProgram(dafnyProgramName, targetProgramText, callToMain, targetPaths.Filename, otherFileNames, + var (compiledCorrectly, compilationResult) = await compiler.CompileTargetProgram(dafnyProgramName, + targetProgramText, callToMain, targetPaths.Filename, otherFileNames, hasMain && options.RunAfterCompile, outputWriter); if (compiledCorrectly && options.RunAfterCompile) { if (hasMain) { diff --git a/Source/TestDafny/MultiBackendTest.cs b/Source/TestDafny/MultiBackendTest.cs index 2598b3d6a2b..0e9f1f7ea50 100644 --- a/Source/TestDafny/MultiBackendTest.cs +++ b/Source/TestDafny/MultiBackendTest.cs @@ -355,7 +355,7 @@ private async Task RunWithCompiler(ForEachCompilerOptions options, IExecuta } // If we hit errors, check for known unsupported features or bugs for this compilation target - if (error == "" && HasUnsupported(backend, outputString)) { + if (error == "" && OnlyAllowedOutputLines(backend, outputString)) { return 0; } @@ -419,42 +419,6 @@ public static IList ReadAllLines(string s) { return (exitCode, outputWriter.ToString(), errorWriter.ToString()); } - private static bool HasUnsupported(IExecutableBackend backend, string output) { - using StringReader sr = new StringReader(output); - if (output == "") { - return false; - } - while (sr.ReadLine() is { } line) { - if (IsSupportedFeatureLine(backend, line)) { - return true; - } - } - - return false; - } - - private static bool IsSupportedFeatureLine(IExecutableBackend backend, string line) { - line = line.Trim(); - if (line.Length == 0) { - return true; - } - - var prefixIndex = line.IndexOf(UnsupportedFeatureException.MessagePrefix, StringComparison.Ordinal); - if (prefixIndex < 0) { - return false; - } - - var featureDescription = line[(prefixIndex + UnsupportedFeatureException.MessagePrefix.Length)..]; - var feature = FeatureDescriptionAttribute.ForDescription(featureDescription); - if (backend.UnsupportedFeatures.Contains(feature)) { - return true; - } - - // This is an internal inconsistency error - throw new Exception( - $"Compiler rejected feature '{feature}', which is not an element of its UnsupportedFeatures set"); - } - private static bool OnlyAllowedOutputLines(IExecutableBackend backend, string output) { using StringReader sr = new StringReader(output); if (output == "") { From d06492eb63b5bcfce45a6dae28824d18e5456871 Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Wed, 17 Apr 2024 11:38:52 +0200 Subject: [PATCH 24/26] Do not migrate ErasableTypeWrappers to use --unicode-char --- .../LitTests/LitTest/comp/ErasableTypeWrappers.dfy | 2 +- .../LitTests/LitTest/comp/ErasableTypeWrappers.dfy.expect | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy index 9f2506e8f69..fc5f494d48f 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy @@ -1,4 +1,4 @@ -// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --type-system-refresh --general-traits=datatype +// RUN: %testDafnyForEachCompiler --refresh-exit-code=0 "%s" -- --relax-definite-assignment --spill-translation --allow-deprecation --unicode-char false --type-system-refresh --general-traits=datatype datatype SingletonRecord = SingletonRecord(u: int) datatype GhostOrNot = ghost Ghost(a: int, b: int) | Compiled(x: int) diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy.expect index 4d509fa4669..1466b3dce90 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy.expect @@ -1,4 +1,4 @@ -62 63 (2, 5) (2, 5) 3 ['<', 'g', 'e', 'n', '>'] +62 63 (2, 5) (2, 5) 3 62 63 5 5 3 5 5 3 1062 1063 1005 1005 1003 @@ -10,13 +10,13 @@ true false true false true false 0 (0, 0) 0 Color.Pink 13 13 13 GenericDouble.GenericDouble(13, 0) 0 13 false -['<', 'g', 'e', 'n', '>'] 3.14 2.7 + 3.14 2.7 18.0 18.0 3.0 false 18.0 4.0 true HasConst.MakeC(4) (4, 4) 4 (4, 4) OptimizationChecks.Ints.Ints(5, 7) OptimizationChecks.Ints.Ints(5, 7) OptimizationChecks.Ints.AnotherIntsWrapper(OptimizationChecks.Ints.Ints(5, 7)) -'D' 'D' +D D 5 5 ConditionsThatDisableTheOptimization.WithTrait.WithTrait(40) 5 5 ConditionsThatDisableTheOptimization.WithCompiledField.WithCompiledField(41) 100 42 From 18d70597173ef47d59df529e9218377a02dd5808 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Wed, 17 Apr 2024 14:59:41 -0700 Subject: [PATCH 25/26] Use SimplifyTypeAndTrimNewtypes consistently in EmitPrintStmt --- Source/DafnyCore/Backends/CSharp/CsharpCodeGenerator.cs | 5 +++-- Source/DafnyCore/Backends/GoLang/GoCodeGenerator.cs | 2 +- .../DafnyCore/Backends/JavaScript/JavaScriptCodeGenerator.cs | 2 +- Source/DafnyCore/Backends/Python/PythonCodeGenerator.cs | 2 +- .../LitTests/LitTest/comp/ErasableTypeWrappers.dfy.expect | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/DafnyCore/Backends/CSharp/CsharpCodeGenerator.cs b/Source/DafnyCore/Backends/CSharp/CsharpCodeGenerator.cs index abe2990611c..a7aa428eb21 100644 --- a/Source/DafnyCore/Backends/CSharp/CsharpCodeGenerator.cs +++ b/Source/DafnyCore/Backends/CSharp/CsharpCodeGenerator.cs @@ -1993,8 +1993,9 @@ protected override void EmitActualTypeArgs(List typeArgs, IToken tok, Conc protected override void EmitPrintStmt(ConcreteSyntaxTree wr, Expression arg) { var wStmts = wr.Fork(); - var typeArgs = arg.Type.AsArrowType == null ? "" : $"<{TypeName(arg.Type, wr, null, null)}>"; - var suffix = arg.Type.IsStringType && UnicodeCharEnabled ? ".ToVerbatimString(false)" : ""; + var type = DatatypeWrapperEraser.SimplifyTypeAndTrimNewtypes(Options, arg.Type); + var typeArgs = type.AsArrowType == null ? "" : $"<{TypeName(type, wr, null, null)}>"; + var suffix = type.IsStringType && UnicodeCharEnabled ? ".ToVerbatimString(false)" : ""; wr.WriteLine($"{DafnyHelpersClass}.Print{typeArgs}(({Expr(arg, false, wStmts)}){suffix});"); } diff --git a/Source/DafnyCore/Backends/GoLang/GoCodeGenerator.cs b/Source/DafnyCore/Backends/GoLang/GoCodeGenerator.cs index 961ed13aa8e..a1a507cf830 100644 --- a/Source/DafnyCore/Backends/GoLang/GoCodeGenerator.cs +++ b/Source/DafnyCore/Backends/GoLang/GoCodeGenerator.cs @@ -1903,7 +1903,7 @@ protected override void EmitMultiAssignment(List lhsExprs, List typeArgs, IToken tok, Conc // ----- Statements ------------------------------------------------------------- protected override void EmitPrintStmt(ConcreteSyntaxTree wr, Expression arg) { - bool isString = arg.Type.NormalizeToAncestorType().IsStringType; + bool isString = DatatypeWrapperEraser.SimplifyTypeAndTrimNewtypes(Options, arg.Type).IsStringType; bool isStringLiteral = arg is StringLiteralExpr; bool isGeneric = arg.Type.NormalizeToAncestorType().AsSeqType is { Arg.IsTypeParameter: true }; var wStmts = wr.Fork(); diff --git a/Source/DafnyCore/Backends/Python/PythonCodeGenerator.cs b/Source/DafnyCore/Backends/Python/PythonCodeGenerator.cs index 7b61fee09fc..ce3848cacd4 100644 --- a/Source/DafnyCore/Backends/Python/PythonCodeGenerator.cs +++ b/Source/DafnyCore/Backends/Python/PythonCodeGenerator.cs @@ -862,7 +862,7 @@ protected override void EmitPrintStmt(ConcreteSyntaxTree wr, Expression arg) { } private void EmitToString(ConcreteSyntaxTree wr, Expression arg, ConcreteSyntaxTree wStmts) { - if (UnicodeCharEnabled && arg.Type.IsStringType) { + if (UnicodeCharEnabled && DatatypeWrapperEraser.SimplifyTypeAndTrimNewtypes(Options, arg.Type).IsStringType) { TrParenExpr(arg, wr, false, wStmts); wr.Write(".VerbatimString(False)"); } else { diff --git a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy.expect b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy.expect index 4d509fa4669..5db18915178 100644 --- a/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy.expect +++ b/Source/IntegrationTests/TestFiles/LitTests/LitTest/comp/ErasableTypeWrappers.dfy.expect @@ -1,4 +1,4 @@ -62 63 (2, 5) (2, 5) 3 ['<', 'g', 'e', 'n', '>'] +62 63 (2, 5) (2, 5) 3 62 63 5 5 3 5 5 3 1062 1063 1005 1005 1003 From 87dcec480f4417219dc13978c58c2b432269c9ee Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Thu, 18 Apr 2024 11:30:57 +0200 Subject: [PATCH 26/26] Undo change --- Source/TestDafny/MultiBackendTest.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Source/TestDafny/MultiBackendTest.cs b/Source/TestDafny/MultiBackendTest.cs index a0c442ce6ea..3741df1f1b6 100644 --- a/Source/TestDafny/MultiBackendTest.cs +++ b/Source/TestDafny/MultiBackendTest.cs @@ -340,7 +340,6 @@ private async Task RunWithCompiler(ForEachCompilerOptions options, IExecuta var (exitCode, outputString, error) = await RunDafny(options.DafnyCliPath, dafnyArgs); var compilationOutputPrior = new Regex("\r?\nDafny program verifier[^\r\n]*\r?\n").Match(outputString); - if (compilationOutputPrior.Success) { outputString = outputString.Remove(0, compilationOutputPrior.Index + compilationOutputPrior.Length); } @@ -375,11 +374,6 @@ private async Task RunWithCompiler(ForEachCompilerOptions options, IExecuta return checkResult; } - // If we hit errors, check for known unsupported features or bugs for this compilation target - if (error == "" && OnlyAllowedOutputLines(backend, outputString)) { - return 0; - } - await output.WriteLineAsync("Execution failed, for reasons other than known unsupported features. Output:"); await output.WriteLineAsync(outputString); await output.WriteLineAsync("Error:");