40 lines
851 B
Text
40 lines
851 B
Text
val test = fn(a, b) {
|
|
join([
|
|
"not {{a}}: {{not a}}",
|
|
"{{a}} and {{b}}: {{a and b}}",
|
|
"{{a}} nand {{b}}: {{a nand b}}",
|
|
"{{a}} or {{b}}: {{a or b}}",
|
|
"{{a}} nor {{b}}: {{a nor b}}",
|
|
"{{a}} xor {{b}}: {{a xor b}}",
|
|
"{{a}} nxor {{b}}: {{a nxor b}}",
|
|
"",
|
|
|
|
"not? {{a}}: {{not? a}}",
|
|
"{{a}} and? {{b}}: {{a and? b}}",
|
|
"{{a}} nand? {{b}}: {{a nand? b}}",
|
|
"{{a}} or? {{b}}: {{a or? b}}",
|
|
"{{a}} nor? {{b}}: {{a nor? b}}",
|
|
"{{a}} xor? {{b}}: {{a xor? b}}",
|
|
"{{a}} nxor? {{b}}: {{a nxor? b}}",
|
|
"\n",
|
|
],
|
|
delim="\n")
|
|
}
|
|
|
|
val tests = [
|
|
[true, false],
|
|
[false, true],
|
|
[true, true],
|
|
[false, false],
|
|
|
|
# including null...
|
|
[true, null],
|
|
[null, true],
|
|
[false, null],
|
|
[null, false],
|
|
[null, null],
|
|
]
|
|
|
|
for t in tests {
|
|
write test(t[1], t[2])
|
|
}
|