Commit Graph

2 Commits

Author SHA1 Message Date
Bob Nystrom
15560a95f6 chore: move truthiness tests from if/ to for/ directory with Iter class
The truth.wren test file is relocated from test/if/ to test/for/, and the test logic is rewritten to use a custom Iter class with for-in loops instead of if statements, while preserving the same truthiness assertions for false, null, true, 0, and empty string values.
2014-04-19 18:41:21 +00:00
Bob Nystrom
a5c4918a75 feat: treat null as falsey in conditional and logical operator branches
Update the VM interpreter to treat null as falsey alongside false in if, while, for, and logical AND/OR operations. Remove the TODO comment and adjust short-circuit logic in OP_JUMP_IF and OP_JUMP_IF_NOT branches. Refactor existing test files into subdirectories (if/, logical_operator/, while/) and add dedicated truthiness tests for each construct. Remove old test/if.wren and update and/or tests to exclude null/0/"" truthiness checks now that null is falsey.
2014-01-21 02:12:55 +00:00