Skip to content
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
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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 Oct 23, 2022
4827da7
Fix Rescript and FSharp tests
OceanOak Oct 23, 2022
4d06bb6
Handle exceptions in Rescript and Ocaml
OceanOak Oct 23, 2022
1153343
Handle exceptions in FSharp + generate all int tests in one file
OceanOak Oct 23, 2022
412bff0
Remove json folder
OceanOak Oct 23, 2022
a03e16a
Use a new method to generate tests
OceanOak Oct 24, 2022
3b0cf6e
Clean up code, add remaining Int tests and Bool tests
OceanOak Oct 26, 2022
fcf500a
Add FloatTest functions' yaml files
OceanOak Oct 26, 2022
95285f7
Fix functions that have a string return type
OceanOak Oct 27, 2022
7eb906f
Add Option, Tuple2 and Tuple3 yaml files + add support for array retu…
OceanOak Oct 28, 2022
b67ba17
Add FunTest yaml files
OceanOak Oct 30, 2022
6ce6fca
Add some of ArrayTest's functions yaml files
OceanOak Oct 30, 2022
757940b
Add more ArrayTest's functions yaml files
OceanOak Oct 30, 2022
7b6e9a6
Add more ArrayTest's functions yaml files
OceanOak Oct 31, 2022
addba11
Add StringTest's functions yaml files
OceanOak Oct 31, 2022
e6c2ed4
Add CharTest's functions yaml files
OceanOak Oct 31, 2022
fa590e7
Add CharTest's functions test files
OceanOak Oct 31, 2022
ab120f0
Add the remaining StringTest's functions yaml files
OceanOak Nov 1, 2022
1fe0f59
Add more ArrayTest's functions yaml files
OceanOak Nov 1, 2022
45d86aa
Minor fixes
OceanOak Nov 1, 2022
b24e445
Clean up code + generate tests in the same file
OceanOak Nov 1, 2022
66d9f41
Fix FloatTest's yaml files
OceanOak Nov 1, 2022
9cad9a1
Fix FloatTest's yaml file + generate some Float tests
OceanOak Nov 1, 2022
f8f2173
Add some ListTest's yaml files
OceanOak Nov 1, 2022
64324b7
Add more ListTest's yaml files
OceanOak Nov 2, 2022
7e87528
Generate tests in one file including test header + Delete separate files
OceanOak Nov 2, 2022
b2693b0
Remove unnecessary variables + rename some variables
OceanOak Nov 2, 2022
ed9939d
Minor fixes
OceanOak Nov 2, 2022
e5e7a9e
Add FloatTest and fix FloatTest yaml files
OceanOak Nov 3, 2022
e192e12
Specify whether inputs need labels in the yaml files
OceanOak Nov 4, 2022
32fbbf2
Add labels + Fix some yaml files
OceanOak Nov 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions bsconfig.json
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"
}
}
45 changes: 45 additions & 0 deletions json-files/Int.absolute.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"module": "Int",
Copy link
Member

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

"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"
}
53 changes: 53 additions & 0 deletions json-files/Int.add.json
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"
}
125 changes: 125 additions & 0 deletions json-files/Int.clamp.json
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"
}
67 changes: 67 additions & 0 deletions json-files/Int.divide.json
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"
}
Loading