Files
wren/test/language/logical_operator/or.wren
T
Bob Nystrom aa72900a9e feat: replace IO class with System class and remove separate IO module
- Delete wren_io.c, wren_io.h, and io.wren source files
- Remove multi-arity print overloads and IO.read/IO.time methods
- Add System class with print, printAll, write, writeAll methods to core.wren
- Update all documentation examples and README to use System.print instead of IO.print
2015-09-15 14:46:09 +00:00

21 lines
684 B
Plaintext

// Note: These tests implicitly depend on ints being truthy.
// Also rely on System.print() returning its argument.
// Return the first true argument.
System.print(1 || true) // expect: 1
System.print(false || 1) // expect: 1
System.print(false || false || true) // expect: true
// Return the last argument if all are false.
System.print(false || false) // expect: false
System.print(false || false || false) // expect: false
// Short-circuit at the first true argument.
System.print(false) || // expect: false
System.print(true) || // expect: true
System.print(true) // should not print
// Swallow a trailing newline.
System.print(true ||
true) // expect: true