-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
103 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
let aff = fun a b x -> a * x + b |
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,78 @@ | ||
[ | ||
{ | ||
"section": [ | ||
{ | ||
"text": "Function:" | ||
}, | ||
{ | ||
"text": "aff", | ||
"display": "code" | ||
} | ||
], | ||
"contents": [ | ||
{ | ||
"message": [ | ||
{ | ||
"text": "Found" | ||
}, | ||
{ | ||
"text": "aff", | ||
"display": "code" | ||
}, | ||
{ | ||
"text": "with compatible type." | ||
} | ||
], | ||
"result": "informative" | ||
}, | ||
{ | ||
"message": [ | ||
{ | ||
"text": "Computing" | ||
}, | ||
{ | ||
"text": "aff 2 (-1) 5", | ||
"display": "code" | ||
} | ||
], | ||
"result": "informative" | ||
}, | ||
{ | ||
"message": [ | ||
{ | ||
"text": "Correct value" | ||
}, | ||
{ | ||
"text": "9", | ||
"display": "code" | ||
} | ||
], | ||
"result": 1 | ||
}, | ||
{ | ||
"message": [ | ||
{ | ||
"text": "Computing" | ||
}, | ||
{ | ||
"text": "aff (-2) 1 5", | ||
"display": "code" | ||
} | ||
], | ||
"result": "informative" | ||
}, | ||
{ | ||
"message": [ | ||
{ | ||
"text": "Correct value" | ||
}, | ||
{ | ||
"text": "(-9)", | ||
"display": "code" | ||
} | ||
], | ||
"result": 1 | ||
} | ||
] | ||
} | ||
] |
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,5 @@ | ||
{ "learnocaml_version": "1", | ||
"groups": | ||
{ "demo": | ||
{ "title": "Test negative_int", | ||
"exercises": [ "int_exo" ] } } } |
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,3 @@ | ||
# Test negative_int | ||
|
||
This exercise is just a regression test with pretty-printing negative `int`s. |
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,2 @@ | ||
{"learnocaml_version":"1","kind":"exercise","stars":0, | ||
"title":"Test negative_int"} |
Empty file.
Empty file.
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 @@ | ||
let aff a b x = a * x + b |
Empty file.
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,13 @@ | ||
open Test_lib | ||
open Report | ||
|
||
let () = | ||
set_result @@ | ||
ast_sanity_check code_ast @@ fun () -> | ||
[ Section | ||
([ Text "Function:" ; Code "aff" ], | ||
let prot = [%funty: int -> int -> int -> int] in | ||
test_function_against_solution ~gen:(0) prot "aff" | ||
[2 @: (-1) @:!! 5; | ||
(-2) @: 1 @:!! 5]) | ||
] |