Created
December 2, 2010 20:50
-
-
Save Vaguery/726034 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Feature: Pile return values | |
| In order to interpret a Pile script as a function of x | |
| As a symbolic regression modeler | |
| I want a scalar value to be returned from any executed script | |
| Scenario: return value is the top stack item after execution | |
| Given the Pile script "1.2 3.4 +" | |
| When I execute it with x = 1 | |
| Then the returned value should be 4.6 | |
| Scenario: returning a value does NOT pop it from the stack | |
| Given the Pile script "1.2 3.4 + 5.6 7.8 +" | |
| When I execute it with x = 1 | |
| Then the returned value should be 13.4 | |
| And the stack should contain 2 items | |
| Scenario: return 1000000000.0 if the stack is empty | |
| Given the Pile script "* / + -" | |
| When I execute it with x = 9.1 | |
| Then the returned value should be 1000000000.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment