Skip to content

Commit

Permalink
Tests: Add comptime bitwise operator test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattco98 committed Oct 5, 2022
1 parent 10fa59d commit 22ddb06
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ class Interpreter(element: JaktPsiElement) {
is JaktTupleExpression -> ExecutionResult.Normal(TupleValue(element.expressionList.map { e ->
evaluateNonYield(e) { return it }
}.toMutableList()))
is JaktParenExpression -> evaluate(element.expression!!)

/*** STATEMENTS ***/

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.serenityos.jakt.comptime

class JaktBasicComptimeTest : JaktComptimeTest() {
fun `test bitwise operators`() = doStdoutTest("""
comptime bitwise() {
if (((0x123 ^ 0x456) << 12) | (0x789 & 0xabc)) == 0x575288 {
print("PASS")
} else {
print("FAIL")
}
}
function main() {
bitwise()
//^T
}
""".trimIndent(), "PASS")
}

0 comments on commit 22ddb06

Please # to comment.