Commit d39e28e
authored
[toml] Implement a TOML parser as package
This pull request includes several changes to improve the testing and
packaging of the `decimojo` and `tomlmojo` libraries. The most important
changes involve implementing a TOML parser in package `tomlmojo`,
restructuring the test cases to load from a TOML file, adding new test
cases, and updating the packaging commands.
Improvements to testing:
*
[`tests/biguint/test_biguint_arithmetics.mojo`](diffhunk://#diff-855e834af415ace9cb8340506c824c86a99bed282917f2d90075705170195827R7-R52):
Refactored the test functions (`test_add`, `test_subtract`,
`test_multiply`, `test_extreme_cases`) to load test cases from a TOML
file and added structured `TestCase` for better test management.
[[1]](diffhunk://#diff-855e834af415ace9cb8340506c824c86a99bed282917f2d90075705170195827R7-R52)
[[2]](diffhunk://#diff-855e834af415ace9cb8340506c824c86a99bed282917f2d90075705170195827L81-L132)
[[3]](diffhunk://#diff-855e834af415ace9cb8340506c824c86a99bed282917f2d90075705170195827L142-R108)
[[4]](diffhunk://#diff-855e834af415ace9cb8340506c824c86a99bed282917f2d90075705170195827L185-R163)
*
[`src/decimojo/tests.mojo`](diffhunk://#diff-2111591ff6c3243ac0d5ada070d08238c8c1b15e419da7ecc99fd680917252c4R1-R55):
Added a new file to implement `TestCase` struct and functions for
managing test cases.
*
[`tests/biguint/test_data/biguint_arithmetics.toml`](diffhunk://#diff-54c73fb8f7a46321f65b4c3080f874518363de06347f935a232028de46ebd7feR1-R160):
Added a new TOML file to hold test data for BigUInt arithmetic
operations, including addition, subtraction, multiplication, and extreme
cases.
Packaging updates:
*
[`mojoproject.toml`](diffhunk://#diff-1b0ef62120bccf4c05a76e60e13fe686f33eb92d5897b3f05e0c3f8d737fc5c0L20-R26):
Updated the packaging commands to include separate packaging for
`decimojo` and `tomlmojo` libraries and updated the clean command to
remove additional files.
Licensing and documentation:
*
[`src/decimojo/__init__.mojo`](diffhunk://#diff-6499d0e8dbd5799013a6c0d8a5539d86b3d7d1d32ee6983f110d14ca0b4d06ffL2-L4):
Removed redundant comments and updated the file header.
*
[`src/tomlmojo/__init__.mojo`](diffhunk://#diff-d640b9adf5ccc6ab3c2585fae60a6598e1f6d6a9130949bc48e73ab7eaaae77fR1-R21):
Added a new file with licensing information and initial import
statements for TOML parsing.tomlmojo and use it to re-factor tests (#63)1 parent fba2fa8 commit d39e28e
File tree
12 files changed
+1593
-550
lines changed- .github/workflows
- src
- decimojo
- tomlmojo
- tests/biguint
- test_data
12 files changed
+1593
-550
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | | - | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | 2 | | |
6 | 3 | | |
7 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments