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

Creating a list of constant: m give wrong results / core dumps, parenthesis with multiples sub-expression either #13

Open
robinmoussu opened this issue Jun 2, 2018 · 2 comments

Comments

@robinmoussu
Copy link

I was trying to write unit test, and I was searching a was trying to find the best way to have deterministic test (I would like to use constant instead of dices to test the operators).

I don't this issue need to be fixed now, I just would like to have a workaround.

$dice "3;4;5;1;ms"
zsh: segmentation fault (core dumped)  ./*/bin/dice "3;4;5;1;ms"

With d1 instead of constant it doesn't work either:

$dice "3d1;4d1;5d1;1d1;ms"
zsh: segmentation fault (core dumped)  ./*/bin/dice "3d1;4d1;5d1;1d1;ms"

I tried removing the ; before the m. The m operator dosen't do his job

$dice "3;4;5;1ms"
Result: 0 - details:[3;4;5;1ms ()]

At least the d1 version works (but it's obviously what I want to do)

$dice "3d1;4d1;5d1;1d1ms"
Result: 13 - details:[3d1;4d1;5d1;1d1ms (1 1 1 1 1 1 1 1 1 1 1 1 1)]

So I tried to do it with the L dice

$dice "L[3];L[4];L[5];L[1]"
3 ; 4 ; 5 ; 1
$dice "L[3];L[4];L[5];L[1];m"
zsh: segmentation fault (core dumped)  ./*/bin/dice "L[3];L[4];L[5];L[1];m"

But unfortunatly, m don't works with list, it look like

$dice "L[3];L[4];L[5];L[1]m"
1

Btw, I also tried to use parenthesis instead of m, and it's not working as expected

$dice "(3;4;5;1)s"
Result: 3,4,5,1 - details:[(3;4;5;1)s ()]
@robinmoussu
Copy link
Author

robinmoussu commented Jun 2, 2018

Ideally, the last syntax ((3;4;5;1)ms) is the one I would probably prefer.

In fact I think that I will need at one point a way to specify the full list of all the next rolls, if I want to be able to unit test the reroll and reroll until operator (witch could be only accessible in c++, not necessarily from the cli).

@robinmoussu
Copy link
Author

I was able to mock the dices (see PR #15), so I don't think this issue is urgent. You may consider close it if you will.

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

No branches or pull requests

1 participant