-
Notifications
You must be signed in to change notification settings - Fork 789
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add langversion support for --- underscore in 'for _ includes version…
… testing
- Loading branch information
1 parent
f08fb25
commit 51538fd
Showing
9 changed files
with
2,956 additions
and
2,854 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
//<Expects id="FS0525" status="error" span="(21,9)">An integer for loop must use a simple identifier</Expects> | ||
module Global | ||
|
||
let failures = ref [] | ||
|
||
let report_failure (s : string) = | ||
stderr.Write" NO: " | ||
stderr.WriteLine s | ||
failures := !failures @ [s] | ||
|
||
let test (s : string) b = | ||
stderr.Write(s) | ||
if b then stderr.WriteLine " OK" | ||
else report_failure (s) | ||
|
||
let check s b1 b2 = test s (b1 = b2) | ||
|
||
// usingWildcard counts using a wildcard in a for loop | ||
let usingWildcard () = | ||
let mutable sum = 0 | ||
for _ = 0 to count do | ||
sum <- sum + 1 | ||
|
||
printfn "usingWildcards expected to produce sum of 4 : sum='%d'"sum | ||
|
||
do test "wildCard" (4 = usingWildcard () ) | ||
|
||
#if TESTS_AS_APP | ||
let RUN() = !failures | ||
#else | ||
let aa = | ||
match !failures with | ||
| [] -> | ||
stdout.WriteLine "Test Passed" | ||
System.IO.File.WriteAllText("test.ok","ok") | ||
exit 0 | ||
| _ -> | ||
stdout.WriteLine "Test Failed" | ||
exit 1 | ||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//<Expects status="success">usingWildcards expected to produce sum of 4 : sum='4'</Expects> | ||
#if TESTS_AS_APP | ||
module Core_forexpression_47 | ||
#endif | ||
|
||
let failures = ref [] | ||
|
||
let report_failure (s : string) = | ||
stderr.Write" NO: " | ||
stderr.WriteLine s | ||
failures := !failures @ [s] | ||
|
||
let test (s : string) b = | ||
stderr.Write(s) | ||
if b then stderr.WriteLine " OK" | ||
else report_failure (s) | ||
|
||
let check s b1 b2 = test s (b1 = b2) | ||
|
||
// usingWildcard counts using a wildcard in a for loop | ||
let usingWildcard () = | ||
let mutable sum = 0 | ||
for _ = 0 to count do | ||
sum <- sum + 1 | ||
|
||
printfn "usingWildcards expected to produce sum of 4 : sum='%d'"sum | ||
|
||
do test "wildCard" (4 = usingWildcard () ) | ||
|
||
#if TESTS_AS_APP | ||
let RUN() = !failures | ||
#else | ||
let aa = | ||
match !failures with | ||
| [] -> | ||
stdout.WriteLine "Test Passed" | ||
System.IO.File.WriteAllText("test.ok","ok") | ||
exit 0 | ||
| _ -> | ||
stdout.WriteLine "Test Failed" | ||
exit 1 | ||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.