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

Extract parse() function, and add unittest for Diceparser #15

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
2 changes: 1 addition & 1 deletion unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ SET( unittest_sources
../node/countexecutenode.cpp
../node/dicerollernode.cpp
../node/executionnode.cpp
../node/explosedicenode.cpp
../node/explodedicenode.cpp
../node/helpnode.cpp
../node/mergenode.cpp
../node/jumpbackwardnode.cpp
Expand Down
2 changes: 2 additions & 0 deletions unittest/unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ TEST_CASE("group", "operator") {
CHECK( roll("4d10g10", {2,2,9,9}) == "2" );
CHECK( roll("4d10g10", {7,4,3,6}) == "2" );
CHECK( roll("4d10g10", {8,4,3,7}) == "2" );
CHECK( roll("12d100g100", {/* group A = 100 */ 50, 25, 25, /* group B = 100 */ 33, 34, 32, 1, /* group C = 100 */ 10, 11, 12, 13, 54}) == "3" );
Copy link
Member

Choose a reason for hiding this comment

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

I try to debug it but G operator receive as previous result: 51, 51,51, 51,51, 51,51, 51,51, 51,51, 51.
The problem is there not in the g operator.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, I will check.

Copy link
Author

Choose a reason for hiding this comment

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

I this I found the issue. I will push the fix tomorow.

CHECK( roll("12d100g100", {/* group A = 103 */ 50, 28, 25, /* group B = 104 */ 33, 34, 32, 5, /* group C = 101 */ 9, 11, 12, 13, 56}) == "3" );
}

TEST_CASE("comment", "operator") {
Expand Down