Skip to content

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

@robinmoussu

Description

@robinmoussu

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 ()]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions