-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate test files #312
Open
OceanOak
wants to merge
31
commits into
darklang:main
Choose a base branch
from
OceanOak:generate-test-files
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Generate test files #312
Changes from 3 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
12ec1e0
Create yaml file with test cases for Int module + generate some tests
OceanOak 4827da7
Fix Rescript and FSharp tests
OceanOak 4d06bb6
Handle exceptions in Rescript and Ocaml
OceanOak 1153343
Handle exceptions in FSharp + generate all int tests in one file
OceanOak 412bff0
Remove json folder
OceanOak a03e16a
Use a new method to generate tests
OceanOak 3b0cf6e
Clean up code, add remaining Int tests and Bool tests
OceanOak fcf500a
Add FloatTest functions' yaml files
OceanOak 95285f7
Fix functions that have a string return type
OceanOak 7eb906f
Add Option, Tuple2 and Tuple3 yaml files + add support for array retu…
OceanOak b67ba17
Add FunTest yaml files
OceanOak 6ce6fca
Add some of ArrayTest's functions yaml files
OceanOak 757940b
Add more ArrayTest's functions yaml files
OceanOak 7b6e9a6
Add more ArrayTest's functions yaml files
OceanOak addba11
Add StringTest's functions yaml files
OceanOak e6c2ed4
Add CharTest's functions yaml files
OceanOak fa590e7
Add CharTest's functions test files
OceanOak ab120f0
Add the remaining StringTest's functions yaml files
OceanOak 1fe0f59
Add more ArrayTest's functions yaml files
OceanOak 45d86aa
Minor fixes
OceanOak b24e445
Clean up code + generate tests in the same file
OceanOak 66d9f41
Fix FloatTest's yaml files
OceanOak 9cad9a1
Fix FloatTest's yaml file + generate some Float tests
OceanOak f8f2173
Add some ListTest's yaml files
OceanOak 64324b7
Add more ListTest's yaml files
OceanOak 7e87528
Generate tests in one file including test header + Delete separate files
OceanOak b2693b0
Remove unnecessary variables + rename some variables
OceanOak ed9939d
Minor fixes
OceanOak e5e7a9e
Add FloatTest and fix FloatTest yaml files
OceanOak e192e12
Specify whether inputs need labels in the yaml files
OceanOak 32fbbf2
Add labels + Fix some yaml files
OceanOak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,18 @@ | ||
{ | ||
"name": "tablecloth", | ||
"version": "0.0.1", | ||
"sources": { | ||
"dir" : "src", | ||
"subdirs" : true | ||
}, | ||
"package-specs": { | ||
"module": "commonjs", | ||
"in-source": true | ||
}, | ||
"suffix": ".bs.js", | ||
"bs-dependencies": [ | ||
], | ||
"warnings": { | ||
"error" : "+101" | ||
} | ||
} |
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,45 @@ | ||
{ | ||
"module": "Int", | ||
"name": "absolute", | ||
"docstring": "Get the absolute value of <param a>", | ||
"parameters": [ | ||
{ | ||
"name": "a", | ||
"type": "int" | ||
} | ||
], | ||
"returnType": "int", | ||
"constraints": [ | ||
"no-ocaml", | ||
"no-rescript" | ||
], | ||
"tests": [ | ||
{ | ||
"inputs": 8, | ||
"output": 8 | ||
}, | ||
{ | ||
"inputs": -7, | ||
"output": 7 | ||
}, | ||
{ | ||
"inputs": 0, | ||
"output": 0 | ||
} | ||
], | ||
"examples": [ | ||
{ | ||
"inputs": 8, | ||
"output": 8 | ||
}, | ||
{ | ||
"inputs": -7, | ||
"output": 7 | ||
}, | ||
{ | ||
"inputs": 0, | ||
"output": 0 | ||
} | ||
], | ||
"added": "0.1.0" | ||
} |
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,53 @@ | ||
{ | ||
"module": "Int", | ||
"name": "add", | ||
"docstring": "Add <param a> to <param b>, returning their sum", | ||
"parameters": [ | ||
{ | ||
"name": "a", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "b", | ||
"type": "int" | ||
} | ||
], | ||
"returnType": "int", | ||
"constraints": [ | ||
"no-ocaml", | ||
"no-rescript" | ||
], | ||
"tests": [ | ||
{ | ||
"inputs": [ | ||
1, | ||
2 | ||
], | ||
"output": 3 | ||
}, | ||
{ | ||
"inputs": [ | ||
1, | ||
1 | ||
], | ||
"output": 2 | ||
} | ||
], | ||
"examples": [ | ||
{ | ||
"inputs": [ | ||
1, | ||
2 | ||
], | ||
"output": 3 | ||
}, | ||
{ | ||
"inputs": [ | ||
1, | ||
1 | ||
], | ||
"output": 2 | ||
} | ||
], | ||
"added": "0.1.0" | ||
} |
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,125 @@ | ||
{ | ||
"module": "Int", | ||
"name": "clamp", | ||
"docstring": "Clamps <param a> within the inclusive [lower] and [upper] bounds and throws a [System.ArgumentOutOfRangeException] exception if <param lower> '>' <param upper>", | ||
"parameters": [ | ||
{ | ||
"name": "a", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "lower", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "upper", | ||
"type": "int" | ||
} | ||
], | ||
"returnType": "int", | ||
"constraints": [ | ||
"no-ocaml", | ||
"no-rescript" | ||
], | ||
"tests": [ | ||
{ | ||
"inputs": [ | ||
5, | ||
0, | ||
8 | ||
], | ||
"output": 5 | ||
}, | ||
{ | ||
"inputs": [ | ||
9, | ||
0, | ||
8 | ||
], | ||
"output": 8 | ||
}, | ||
{ | ||
"inputs": [ | ||
1, | ||
2, | ||
8 | ||
], | ||
"output": 2 | ||
}, | ||
{ | ||
"inputs": [ | ||
5, | ||
-10, | ||
-5 | ||
], | ||
"output": -5 | ||
}, | ||
{ | ||
"inputs": [ | ||
-15, | ||
-10, | ||
-5 | ||
], | ||
"output": -10 | ||
}, | ||
{ | ||
"inputs": [ | ||
3, | ||
-10, | ||
-5 | ||
], | ||
"output": "exception" | ||
} | ||
], | ||
"examples": [ | ||
{ | ||
"inputs": [ | ||
5, | ||
0, | ||
8 | ||
], | ||
"output": 5 | ||
}, | ||
{ | ||
"inputs": [ | ||
9, | ||
0, | ||
8 | ||
], | ||
"output": 8 | ||
}, | ||
{ | ||
"inputs": [ | ||
1, | ||
2, | ||
8 | ||
], | ||
"output": 2 | ||
}, | ||
{ | ||
"inputs": [ | ||
5, | ||
-10, | ||
-5 | ||
], | ||
"output": -5 | ||
}, | ||
{ | ||
"inputs": [ | ||
-15, | ||
-10, | ||
-5 | ||
], | ||
"output": -10 | ||
}, | ||
{ | ||
"inputs": [ | ||
3, | ||
-10, | ||
-5 | ||
], | ||
"output": "exception" | ||
} | ||
], | ||
"added": "0.1.0" | ||
} |
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,67 @@ | ||
{ | ||
"module": "Int", | ||
"name": "divide", | ||
"docstring": "divide <param a> by <param by>, returning their quotient", | ||
"parameters": [ | ||
{ | ||
"name": "a", | ||
"type": "int" | ||
}, | ||
{ | ||
"name": "by", | ||
"type": "int" | ||
} | ||
], | ||
"returnType": "int", | ||
"constraints": [ | ||
"no-ocaml", | ||
"no-rescript" | ||
], | ||
"tests": [ | ||
{ | ||
"inputs": [ | ||
3, | ||
2 | ||
], | ||
"output": 1 | ||
}, | ||
{ | ||
"inputs": [ | ||
3, | ||
0 | ||
], | ||
"output": "exception" | ||
}, | ||
{ | ||
"inputs": [ | ||
27, | ||
5 | ||
], | ||
"output": 5 | ||
} | ||
], | ||
"examples": [ | ||
{ | ||
"inputs": [ | ||
3, | ||
2 | ||
], | ||
"output": 1 | ||
}, | ||
{ | ||
"inputs": [ | ||
3, | ||
0 | ||
], | ||
"output": "exception" | ||
}, | ||
{ | ||
"inputs": [ | ||
27, | ||
5 | ||
], | ||
"output": 5 | ||
} | ||
], | ||
"added": "0.1.0" | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not check in the json files