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

Test cases for loops #54

Open
Zomis opened this issue Sep 13, 2016 · 0 comments
Open

Test cases for loops #54

Zomis opened this issue Sep 13, 2016 · 0 comments

Comments

@Zomis
Copy link
Owner

Zomis commented Sep 13, 2016

It would be nice to be able to test that loops do what they are supposed to do

As a simple example consider the code:

$ nextLoop 'testable-loop'
[+++>++>-]

and the DSL:

$ {
     test 'testable-loop' memory '3 x4 5 2 0 1' expect '3 7 7 1 0 x0'
     test 'testable-loop' memory '3 x4 5 2 0 2 0 1' expect '3 7 7 1 0 4 2 x0'
}

x indicates the memory cell pointer.

Both the above tests should then pass.

Could be useful to test some loops in http://codereview.stackexchange.com/q/57382/31562 , for example to perform one fizz-buzz loop, process one Fizz, etc.

This has potential to be extended quite a bit, for example with expect *, asserting that pointer never leaves the allocated memory, and probably more.

Named memory cells might be useful for parts of this ( #14 )

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

No branches or pull requests

1 participant