Skip to content

Refactor test cases#79

Open
player-03 wants to merge 18 commits intotbrosman:masterfrom
player-03:utest
Open

Refactor test cases#79
player-03 wants to merge 18 commits intotbrosman:masterfrom
player-03:utest

Conversation

@player-03
Copy link
Contributor

@player-03 player-03 commented Sep 21, 2022

I switched to utest, moved tests around so that related tests would go in the same file, rewrote several tests, and added several missing tests. Not all the missing tests, but at least now it'll be easier to spot when a test is missing.

I did use some more advanced Haxe features, such as import.hx (which could easily be reverted) and two macros (which could not). I realize macros can be hard to understand, so I did my best to document them clearly. The macros are required to write shorter and clearer test cases while still getting detailed error messages. If a randomized test fails, it needs to be able to print the values that caused the issue, or you may never be able to reproduce that situation.

This addresses most of #18, but might not be enough to close it.

Using import.hx so that all the functions are imported together.
Trying to make minimal changes to the test cases, except for
`testSparseArray2OrderedKeysIterate`, which printed 10,000 characters.
`testArray2InterfaceCast()`.

Just to be sure DCE won't mess it up.
Except for one that fit better in TestCommonOperations.hx.
Plus, fix a bug where `multiply()` transposes the resulting matrix.
(Maybe due to confusion over whether it was row-major or column-major.)
@skial skial mentioned this pull request Sep 21, 2022
1 task
"tasks": [
{
"label": "hxmath: test in C++",
"command": "haxe test_cpp.hxml --cmd ./bin/cpp",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, this won't work on Windows. Maybe I should just not include tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants