fixup! [PowerAssert] Run all tests without the runtime library
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/CheckCustomMessage.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/CheckCustomMessage.noruntime.box.txt new file mode 100644 index 0000000..7f9bf90 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/CheckCustomMessage.noruntime.box.txt
@@ -0,0 +1,5 @@ +---the world is broken +check(1 == 2) { "the world is broken" } + | + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/ConstantsK2.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/ConstantsK2.noruntime.box.txt new file mode 100644 index 0000000..5adfda1 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/ConstantsK2.noruntime.box.txt
@@ -0,0 +1,39 @@ +---Assertion failed--- +--- +assert(x) + | + false +--- +--- +assert(1 == 2) + | + false +--- +--- +assert(y == 2) + | | + | false + 1 +--- +--- +assert(("Hello" + ", " + "World").length == 0) + | | | + | | false + | 12 + Hello, World +--- +--- +assert("$GREETING, World".length == 0) + | | | | + | | | false + | | 12 + | Hello + Hello, World +--- +--- +assert(WELCOME.length == 0) + | | | + | | false + | 12 + Hello, World +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/CustomLocalVariableMessage.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/CustomLocalVariableMessage.noruntime.box.txt new file mode 100644 index 0000000..4db79a6 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/CustomLocalVariableMessage.noruntime.box.txt
@@ -0,0 +1,5 @@ +---Not equal +assert(1 == 2, lambda) + | + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/CustomMessage.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/CustomMessage.noruntime.box.txt new file mode 100644 index 0000000..fd3e8b9 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/CustomMessage.noruntime.box.txt
@@ -0,0 +1,5 @@ +---Not equal +assert(1 == 2) { "Not equal" } + | + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/MemberFunctions.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/MemberFunctions.noruntime.box.txt new file mode 100644 index 0000000..7b52885 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/MemberFunctions.noruntime.box.txt
@@ -0,0 +1,9 @@ +--- +assert(hello.length == "World".substring(1, 4).length) + | | | | | + | | | | 3 + | | | orl + | | false + | 5 + Hello +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/RequireCustomMessage.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/RequireCustomMessage.noruntime.box.txt new file mode 100644 index 0000000..d5f610b --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/RequireCustomMessage.noruntime.box.txt
@@ -0,0 +1,5 @@ +---the world is broken +require(1 == 2) { "the world is broken" } + | + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/Transformations.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/Transformations.noruntime.box.txt new file mode 100644 index 0000000..b4c4331 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/Transformations.noruntime.box.txt
@@ -0,0 +1,8 @@ +--- +assert(hello.reversed() == emptyList<String>()) + | | | | + | | | [] + | | false + | [World, Hello] + [Hello, World] +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/annotated/DefaultArguments.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/annotated/DefaultArguments.box.txt new file mode 100644 index 0000000..d86bac9 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/annotated/DefaultArguments.box.txt
@@ -0,0 +1 @@ +OK
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/annotated/PluginNotApplied.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/annotated/PluginNotApplied.box.txt new file mode 100644 index 0000000..2e83dd3 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/annotated/PluginNotApplied.box.txt
@@ -0,0 +1 @@ +kotlin.NotImplementedError: Intrinsic property! Make sure the Power-Assert compiler plugin is applied to your build.
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlineAddition.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlineAddition.noruntime.box.txt new file mode 100644 index 0000000..b5c7c61 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlineAddition.noruntime.box.txt
@@ -0,0 +1,13 @@ +test1: --- +assert(1 + 1 == 4) + | | + | false + 2 +--- +test2: --- +assert(a + b) + | | | + | | false + | false + true +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlineDivision.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlineDivision.noruntime.box.txt new file mode 100644 index 0000000..2d9912b --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlineDivision.noruntime.box.txt
@@ -0,0 +1,13 @@ +test1: --- +assert(2 / 1 == 4) + | | + | false + 2 +--- +test2: --- +assert(a / b) + | | | + | | 1 + | false + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlineMultiplication.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlineMultiplication.noruntime.box.txt new file mode 100644 index 0000000..77ba183 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlineMultiplication.noruntime.box.txt
@@ -0,0 +1,13 @@ +test1: --- +assert(1 * 2 == 4) + | | + | false + 2 +--- +test2: --- +assert(a * b) + | | | + | | 2 + | false + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlinePostfixDecrement.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlinePostfixDecrement.noruntime.box.txt new file mode 100644 index 0000000..5a9455a --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlinePostfixDecrement.noruntime.box.txt
@@ -0,0 +1,11 @@ +test1: --- +assert(i-- == 4) + | | + | false + 3 +--- +test2: --- +assert(a--) + | + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlinePostfixIncrement.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlinePostfixIncrement.noruntime.box.txt new file mode 100644 index 0000000..cabe650 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlinePostfixIncrement.noruntime.box.txt
@@ -0,0 +1,6 @@ +--- +assert(i++ == 4) + | | + | false + 1 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlinePrefixDecrement.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlinePrefixDecrement.noruntime.box.txt new file mode 100644 index 0000000..768c4422 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlinePrefixDecrement.noruntime.box.txt
@@ -0,0 +1,11 @@ +test1: --- +assert(--i == 4) + | | + | false + 2 +--- +test2: --- +assert(--a) + | + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlinePrefixIncrement.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlinePrefixIncrement.noruntime.box.txt new file mode 100644 index 0000000..aa94e55 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlinePrefixIncrement.noruntime.box.txt
@@ -0,0 +1,6 @@ +--- +assert(++i == 4) + | | + | false + 2 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlinePrefixUnaryPlus.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlinePrefixUnaryPlus.noruntime.box.txt new file mode 100644 index 0000000..42b349f --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlinePrefixUnaryPlus.noruntime.box.txt
@@ -0,0 +1,13 @@ +test1: --- +assert(+b) + || + |false + false +--- +test2: --- +assert(+b == 3) + || | + || false + |2 + 2 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlineSubtraction.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlineSubtraction.noruntime.box.txt new file mode 100644 index 0000000..ab9c226 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/arithmetic/InlineSubtraction.noruntime.box.txt
@@ -0,0 +1,6 @@ +--- +assert(3 - 1 == 4) + | | + | false + 2 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanAnd.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanAnd.noruntime.box.txt new file mode 100644 index 0000000..695d212 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanAnd.noruntime.box.txt
@@ -0,0 +1,13 @@ +--- +assert(text != null && text.length == 5 && text.lowercase() == text) + | | | | | | | | | + | | | | | | | | Hello + | | | | | | | false + | | | | | | hello + | | | | | Hello + | | | | true + | | | 5 + | | Hello + | true + Hello +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanMixWithAndFirst.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanMixWithAndFirst.noruntime.box.txt new file mode 100644 index 0000000..502ffe4 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanMixWithAndFirst.noruntime.box.txt
@@ -0,0 +1,13 @@ +--- +assert(text != null && (text.length == 1 || text.lowercase() == text)) + | | | | | | | | | + | | | | | | | | Hello + | | | | | | | false + | | | | | | hello + | | | | | Hello + | | | | false + | | | 5 + | | Hello + | true + Hello +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanMixWithAndLast.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanMixWithAndLast.noruntime.box.txt new file mode 100644 index 0000000..9b57d22 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanMixWithAndLast.noruntime.box.txt
@@ -0,0 +1,11 @@ +--- +assert((text.length == 1 || text.lowercase() == text) && text.length == 1) + | | | | | | | + | | | | | | Hello + | | | | | false + | | | | hello + | | | Hello + | | false + | 5 + Hello +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanMixWithAndNot.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanMixWithAndNot.noruntime.box.txt new file mode 100644 index 0000000..116ecac --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanMixWithAndNot.noruntime.box.txt
@@ -0,0 +1,16 @@ +--- +assert(!(text.length == 1 || text.lowercase() == text) && !(text.length == 5)) + | | | | | | | | | | | | + | | | | | | | | | | | true + | | | | | | | | | | 5 + | | | | | | | | | Hello + | | | | | | | | false + | | | | | | | Hello + | | | | | | false + | | | | | hello + | | | | Hello + | | | false + | | 5 + | Hello + true +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanMixWithOrFirst.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanMixWithOrFirst.noruntime.box.txt new file mode 100644 index 0000000..59de30a --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanMixWithOrFirst.noruntime.box.txt
@@ -0,0 +1,13 @@ +--- +assert(text == null || (text.length == 5 && text.lowercase() == text)) + | | | | | | | | | + | | | | | | | | Hello + | | | | | | | false + | | | | | | hello + | | | | | Hello + | | | | true + | | | 5 + | | Hello + | false + Hello +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanMixWithOrLast.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanMixWithOrLast.noruntime.box.txt new file mode 100644 index 0000000..6cf0f2c --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanMixWithOrLast.noruntime.box.txt
@@ -0,0 +1,14 @@ +--- +assert((text.length == 5 && text.lowercase() == text) || text.length == 1) + | | | | | | | | | | + | | | | | | | | | false + | | | | | | | | 5 + | | | | | | | Hello + | | | | | | Hello + | | | | | false + | | | | hello + | | | Hello + | | true + | 5 + Hello +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanNot.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanNot.noruntime.box.txt new file mode 100644 index 0000000..97b7aa6 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanNot.noruntime.box.txt
@@ -0,0 +1,13 @@ +test1: --- +assert(!b) + || + |true + false +--- +test2: --- +assert(!b == true) + || | + || false + |true + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanOr.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanOr.noruntime.box.txt new file mode 100644 index 0000000..dbfdae2 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanOr.noruntime.box.txt
@@ -0,0 +1,13 @@ +--- +assert(text == null || text.length == 1 || text.lowercase() == text) + | | | | | | | | | + | | | | | | | | Hello + | | | | | | | false + | | | | | | hello + | | | | | Hello + | | | | false + | | | 5 + | | Hello + | false + Hello +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanShortCircuit.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanShortCircuit.noruntime.box.txt new file mode 100644 index 0000000..03e2bfb --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/boolean/BooleanShortCircuit.noruntime.box.txt
@@ -0,0 +1,6 @@ +--- +assert(text != null && text.length == 1) + | | + | false + null +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/boundedFunctionReference.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/boundedFunctionReference.noruntime.box.txt new file mode 100644 index 0000000..c3b0326 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/boundedFunctionReference.noruntime.box.txt
@@ -0,0 +1,84 @@ +test1: --- +assert(A::foo == { x: Int -> x % 2 != 0 }) + | | + | false + fun A.foo(kotlin.Int): kotlin.Boolean +--- +test2: --- +assert(A::foo.isInfix) + | | + | false + fun A.foo(kotlin.Int): kotlin.Boolean +--- +test3: --- +assert((A::foo)(A(), 4)) + | || + | |A + | false + fun A.foo(kotlin.Int): kotlin.Boolean +--- +test4: --- +assert(List<Int>::bar.name == "foo") + | | | + | | false + | bar + fun kotlin.collections.List<kotlin.Int>.bar(kotlin.Int): kotlin.Boolean +--- +test5: --- +assert(List<Int>::bar.isInfix) + | | + | false + fun kotlin.collections.List<kotlin.Int>.bar(kotlin.Int): kotlin.Boolean +--- +test6: --- +assert((List<Int>::bar)(listOf(1,2,3), 1)) + | || + | |[1, 2, 3] + | false + fun kotlin.collections.List<kotlin.Int>.bar(kotlin.Int): kotlin.Boolean +--- +test7: --- +assert((a::foo)()) + | | | + | | false + | fun kotlin.String.foo(): kotlin.Boolean + Some text +--- +test8: --- +assert(((a+b)::foo)()) + ||| | | + ||| | false + ||| fun kotlin.String.foo(): kotlin.Boolean + ||b + |ab + a +--- +test9: --- +assert(a::foo == b::foo) + | | | | | + | | | | fun kotlin.String.foo(): kotlin.Boolean + | | | Another text + | | false + | fun kotlin.String.foo(): kotlin.Boolean + Some text +--- +test10: --- +assert(a::foo.isOpen) + | | | + | | false + | fun kotlin.String.foo(): kotlin.Boolean + Some text +--- +test11: --- +assert(A/*::*/::/*::*/foo.isOpen) + | | + | false + fun A.foo(kotlin.Int): kotlin.Boolean +--- +test12: --- +assert(a/*::*/::/*::*/foo.isOpen) + | | | + | | false + | fun kotlin.String.foo(): kotlin.Boolean + Some text +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/boundedPropertyReference.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/boundedPropertyReference.noruntime.box.txt new file mode 100644 index 0000000..6bd9eee --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/boundedPropertyReference.noruntime.box.txt
@@ -0,0 +1,84 @@ +test1: --- +assert(A::foo == { true }) + | | + | false + val A.foo: kotlin.Boolean +--- +test2: --- +assert(A::foo.isOpen) + | | + | false + val A.foo: kotlin.Boolean +--- +test3: --- +assert((A::foo)(A())) + | || + | |A + | false + val A.foo: kotlin.Boolean +--- +test4: --- +assert(List<Int>::bar.name == "foo") + | | | + | | false + | bar + val kotlin.collections.List<kotlin.Int>.bar: kotlin.Boolean +--- +test5: --- +assert(List<Int>::bar.isConst) + | | + | false + val kotlin.collections.List<kotlin.Int>.bar: kotlin.Boolean +--- +test6: --- +assert((List<Int>::bar)(listOf(1,2,3))) + | || + | |[1, 2, 3] + | false + val kotlin.collections.List<kotlin.Int>.bar: kotlin.Boolean +--- +test7: --- +assert((a::foo)()) + | | | + | | false + | val kotlin.String.foo: kotlin.Boolean + Some text +--- +test8: --- +assert(((a+b)::foo)()) + ||| | | + ||| | false + ||| val kotlin.String.foo: kotlin.Boolean + ||b + |ab + a +--- +test9: --- +assert(a::foo == b::foo) + | | | | | + | | | | val kotlin.String.foo: kotlin.Boolean + | | | Another text + | | false + | val kotlin.String.foo: kotlin.Boolean + Some text +--- +test10: --- +assert(a::foo.isOpen) + | | | + | | false + | val kotlin.String.foo: kotlin.Boolean + Some text +--- +test11: --- +assert(A/*::*/::/*::*/foo.isOpen) + | | + | false + val A.foo: kotlin.Boolean +--- +test12: --- +assert(a/*::*/::/*::*/foo.isOpen) + | | | + | | false + | val kotlin.String.foo: kotlin.Boolean + Some text +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/classLiteralReference.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/classLiteralReference.noruntime.box.txt new file mode 100644 index 0000000..a4b4893 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/classLiteralReference.noruntime.box.txt
@@ -0,0 +1,6 @@ +--- +assert(Boolean::class.isOpen) + | | + | false + class kotlin.Boolean +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/functionReference.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/functionReference.noruntime.box.txt new file mode 100644 index 0000000..4802d97 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/functionReference.noruntime.box.txt
@@ -0,0 +1,25 @@ +test1: --- +assert(::foo.name == "bar") + | | | + | | false + | foo + fun foo(kotlin.Int): kotlin.Boolean +--- +test2: --- +assert(::foo.isOpen) + | | + | false + fun foo(kotlin.Int): kotlin.Boolean +--- +test3: --- +assert((::foo)(1)) + | | + | false + fun foo(kotlin.Int): kotlin.Boolean +--- +test4: --- +assert(::/*::*/foo.isOpen) + | | + | false + fun foo(kotlin.Int): kotlin.Boolean +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/functionReferenceWithTypeParameter.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/functionReferenceWithTypeParameter.noruntime.box.txt new file mode 100644 index 0000000..a4d3369 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/functionReferenceWithTypeParameter.noruntime.box.txt
@@ -0,0 +1,26 @@ +test1: --- +assert(ref()) + | | + | false + fun foo(): T +--- +test2: --- +assert(List<Int>::bar.name == "foo") + | | | + | | false + | bar + fun kotlin.collections.List<T>.bar(): kotlin.Boolean +--- +test3: --- +assert(List<T>::bar.isInfix) + | | + | false + fun kotlin.collections.List<T>.bar(): kotlin.Boolean +--- +test4: --- +assert((List<Int>::bar)(listOf())) + | || + | |[] + | false + fun kotlin.collections.List<T>.bar(): kotlin.Boolean +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/propertyReference.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/propertyReference.noruntime.box.txt new file mode 100644 index 0000000..3685e4f --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/propertyReference.noruntime.box.txt
@@ -0,0 +1,19 @@ +test1: --- +assert(::property.isOpen) + | | + | false + val property: kotlin.Boolean +--- +test2: --- +assert(::property.name == "a") + | | | + | | false + | property + val property: kotlin.Boolean +--- +test3: --- +assert((::property)()) + | | + | false + val property: kotlin.Boolean +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/propertyReferenceWithTypeParameter.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/propertyReferenceWithTypeParameter.noruntime.box.txt new file mode 100644 index 0000000..4658910 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/propertyReferenceWithTypeParameter.noruntime.box.txt
@@ -0,0 +1,25 @@ +test1: --- +assert(Int::property.isOpen) + | | + | false + val T.property: T +--- +test2: --- +assert(Int::property.name == "a") + | | | + | | false + | property + val T.property: T +--- +test3: --- +assert((Boolean::property)(false)) + | | + | false + val T.property: T +--- +test4: --- +assert(Boolean::property.get(false)) + | | + | false + val T.property: T +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/referenceToConstructor.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/referenceToConstructor.noruntime.box.txt new file mode 100644 index 0000000..4f49911 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/callableReference/referenceToConstructor.noruntime.box.txt
@@ -0,0 +1,21 @@ +test1: --- +assert((::Person)("Alice", true).name == "Kate") + | | | | + | | | false + | | Alice + | Person(name=Alice, isAlive=true) + fun `<init>`(kotlin.String, kotlin.Boolean): Person +--- +test2: --- +assert((::Person)("Alice", false).isAlive) + | | | + | | false + | Person(name=Alice, isAlive=false) + fun `<init>`(kotlin.String, kotlin.Boolean): Person +--- +test3: --- +assert(::Person.isSuspend) + | | + | false + fun `<init>`(kotlin.String, kotlin.Boolean): Person +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/cast/InstanceEquals.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/cast/InstanceEquals.noruntime.box.txt new file mode 100644 index 0000000..06e3418 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/cast/InstanceEquals.noruntime.box.txt
@@ -0,0 +1,37 @@ +--- +assert(null is String) + | + false +--- +--- +assert(!(" is " is String)) + | | + | true + false +--- +--- +assert(!( + | + false + + " is " + + is + | + true + + String +)) +--- +--- +assert(null/*is*/is/*is*/String) + | + false +--- +--- +assert(!((null is String) is Boolean)) + | | | + | | true + | false + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/cast/InstanceNotEquals.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/cast/InstanceNotEquals.noruntime.box.txt new file mode 100644 index 0000000..6dfbf5d --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/cast/InstanceNotEquals.noruntime.box.txt
@@ -0,0 +1,32 @@ +--- +assert("Hello, world!" !is String) + | + false +--- +--- +assert(" !is " !is String) + | + false +--- +--- +assert( + " !is " + + !is + | + false + + String +) +--- +--- +assert("Hello, world!"/*!is*/!is/*!is*/String) + | + false +--- +--- +assert(("Hello, world!" !is String) !is Boolean) + | | + | false + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/cast/SafeCast.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/cast/SafeCast.noruntime.box.txt new file mode 100644 index 0000000..64b6176 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/cast/SafeCast.noruntime.box.txt
@@ -0,0 +1,22 @@ +--- +assert((a as? String)?.length == 5) + | | | | + | | | false + | | 4 + | test + test +--- +--- +assert((a as? String)?.length == 5) + | | | | + | | | false + | | null + | null + 1 +--- +--- +requireNotNull(a as? String) + | | + | null + 1 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/cast/SafeCast.noruntime.kt.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/cast/SafeCast.noruntime.kt.txt new file mode 100644 index 0000000..8e04901 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/cast/SafeCast.noruntime.kt.txt
@@ -0,0 +1,40 @@ +fun box(): String { + return test1(a = "test").plus(other = test1(a = 1)).plus(other = test2(a = 1)) +} + +fun test1(a: Any): String { + return expectThrowableMessage(block = local fun <anonymous>() { + { // BLOCK + val tmp0_Explain: Any = a + val tmp1_Explain: String? = tmp0_Explain as? String + val tmp2_Explain: Int? = { // BLOCK + val tmp_0: String? = tmp1_Explain + when { + EQEQ(arg0 = tmp_0, arg1 = null) -> null + else -> tmp_0 /*as String */.<get-length>() + } + } + val tmp3_Explain: Int = 5 + val tmp4_Explain: Boolean = EQEQ(arg0 = tmp2_Explain, arg1 = tmp3_Explain) + assert(value = tmp4_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert((a as? String)?.length == 5)" + "\n | | | |" + "\n | | | " + tmp4_Explain + "\n | | " + tmp2_Explain + "\n | " + tmp1_Explain + "\n " + tmp0_Explain + "\n" + } +) + } + } +) +} + +fun test2(a: Any): String { + return expectThrowableMessage(block = local fun <anonymous>() { + { // BLOCK + val tmp0_Explain: Any = a + val tmp1_Explain: String? = tmp0_Explain as? String + requireNotNull<String>(value = tmp1_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nrequireNotNull(a as? String)" + "\n | |" + "\n | " + tmp1_Explain + "\n " + tmp0_Explain + "\n" + } +) + } /*~> Unit */ + } +) +}
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/cast/SmartCast.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/cast/SmartCast.noruntime.box.txt new file mode 100644 index 0000000..82e9073 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/cast/SmartCast.noruntime.box.txt
@@ -0,0 +1,9 @@ +--- +assert(greeting is String && greeting.length == 2) + | | | | | + | | | | false + | | | 5 + | | hello + | true + hello +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/cast/UnsafeCast.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/cast/UnsafeCast.noruntime.box.txt new file mode 100644 index 0000000..ad316e1 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/cast/UnsafeCast.noruntime.box.txt
@@ -0,0 +1,58 @@ +test1: --- +assert((a as String).length == 5) + | | | + | | false + | 4 + test +--- +test2: --- +assert((a as String?)?.length == 5) + | | | + | | false + | 4 + test +--- +test3: --- +assert((a as List<T>).isEmpty()) + | | + | false + [1, 2] +--- +test4: --- +assert((a as List<*>).isEmpty()) + | | + | false + [1, 2] +--- +test5: --- +assert((a as MyString).length == 5) + | | | + | | false + | 4 + test +--- +test6: --- +assert(a as Nothing? == "null") + | | + | false + null +--- +test7: --- +assert((a as MutableList<Int>).add(3) == false) + | | | + | | false + | true + [1, 2, 3] +--- +test8: --- +assert(a as Base + 1) + | | + | false + Base +--- +test9: --- +assert((::foo as () -> Boolean)()) + | | + | false + fun foo(): kotlin.Boolean +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/dbg/DebugEntryFunction.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/dbg/DebugEntryFunction.noruntime.box.txt new file mode 100644 index 0000000..df11565 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/dbg/DebugEntryFunction.noruntime.box.txt
@@ -0,0 +1,8 @@ +---sum=6 + +dbg(operation, 1 + 2 + 3) + | | | + | | 6 + | 3 + sum +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/dbg/DebugEntryFunctionComplexBooleans.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/dbg/DebugEntryFunctionComplexBooleans.noruntime.box.txt new file mode 100644 index 0000000..298b414 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/dbg/DebugEntryFunctionComplexBooleans.noruntime.box.txt
@@ -0,0 +1,15 @@ +---false=true + +dbg( + key = greeting != null && greeting.length == 5, + | | + | false + null + + value = name == null || name.length == 5 + | | + | true + null + +) +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/dbg/DebugEntryFunctionMessage.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/dbg/DebugEntryFunctionMessage.noruntime.box.txt new file mode 100644 index 0000000..5e2a040 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/dbg/DebugEntryFunctionMessage.noruntime.box.txt
@@ -0,0 +1,8 @@ +---sum=6 +Message: +dbg(operation, 1 + 2 + 3, "Message:") + | | | + | | 6 + | 3 + sum +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/dbg/DebugEntryFunctionMessageComplexBooleans.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/dbg/DebugEntryFunctionMessageComplexBooleans.noruntime.box.txt new file mode 100644 index 0000000..8224ec7 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/dbg/DebugEntryFunctionMessageComplexBooleans.noruntime.box.txt
@@ -0,0 +1,16 @@ +---false=true +Message: +dbg( + key = greeting != null && greeting.length == 5, + | | + | false + null + + value = name == null || name.length == 5, + | | + | true + null + + msg = "Message:" +) +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/dbg/DebugFunction.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/dbg/DebugFunction.noruntime.box.txt new file mode 100644 index 0000000..49c16b3 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/dbg/DebugFunction.noruntime.box.txt
@@ -0,0 +1,6 @@ +--- +dbg(1 + 2 + 3) + | | + | 6 + 3 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/dbg/DebugFunctionMessage.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/dbg/DebugFunctionMessage.noruntime.box.txt new file mode 100644 index 0000000..ab1db04 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/dbg/DebugFunctionMessage.noruntime.box.txt
@@ -0,0 +1,6 @@ +---Message: +dbg(1 + 2 + 3, "Message:") + | | + | 6 + 3 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/ElvisOperator.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/ElvisOperator.noruntime.box.txt new file mode 100644 index 0000000..0d7b198 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/ElvisOperator.noruntime.box.txt
@@ -0,0 +1,60 @@ +--- +assert((str?.lowercase()?.length ?: default) == 5) + | | | | + | | | false + | | 4 + | test + TEST +--- +--- +assert((str?.lowercase()?.length ?: default) == 5) + | | | | | + | | | | false + | | | 0 + | | null + | null + null +--- +--- +assert(((str?.lowercase() ?: fallback)?.length ?: default) == 5) + | | | | + | | | false + | | 4 + | test + TEST +--- +--- +assert(((str?.lowercase() ?: fallback)?.length ?: default) == 5) + | | | | | + | | | | false + | | | 4 + | | test + | null + null +--- +--- +assert(((str?.lowercase() ?: fallback)?.length ?: default) == 5) + | | | | | | + | | | | | false + | | | | 0 + | | | null + | | null + | null + null +--- +--- +assert((str?.lowercase()?.length ?: 0) == 5) + | | | | + | | | false + | | 4 + | test + TEST +--- +--- +assert((str?.lowercase()?.length ?: 0) == 5) + | | | | + | | | false + | | null + | null + null +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/ElvisOperator.noruntime.kt.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/ElvisOperator.noruntime.kt.txt new file mode 100644 index 0000000..2c2401a --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/ElvisOperator.noruntime.kt.txt
@@ -0,0 +1,162 @@ +fun box(): String { + return test1(str = "TEST", default = 0).plus(other = test1(str = null, default = 0)).plus(other = test2(str = "TEST", fallback = null, default = 0)).plus(other = test2(str = null, fallback = "test", default = 0)).plus(other = test2(str = null, fallback = null, default = 0)).plus(other = test3(str = "TEST")).plus(other = test3(str = null)) +} + +fun test1(str: String?, default: Int): String { + return expectThrowableMessage(block = local fun <anonymous>() { + { // BLOCK + val tmp0_Explain: String? = str + val tmp1_Explain: String? = { // BLOCK + val tmp_0: String? = tmp0_Explain + when { + EQEQ(arg0 = tmp_0, arg1 = null) -> null + else -> lowercase(/* <this> = tmp_0 /*as String */ */) + } + } + val tmp2_Explain: Int? = { // BLOCK + val tmp_1: String? = tmp1_Explain + when { + EQEQ(arg0 = tmp_1, arg1 = null) -> null + else -> tmp_1 /*as String */.<get-length>() + } + } + when { + EQEQ(arg0 = tmp2_Explain, arg1 = null) -> { // BLOCK + val tmp3_Explain: Int = default + val tmp4_Explain: Int = 5 + val tmp5_Explain: Boolean = EQEQ(arg0 = tmp3_Explain, arg1 = tmp4_Explain) + assert(value = tmp5_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert((str?.lowercase()?.length ?: default) == 5)" + "\n | | | | |" + "\n | | | | " + tmp5_Explain + "\n | | | " + tmp3_Explain + "\n | | " + tmp2_Explain + "\n | " + tmp1_Explain + "\n " + tmp0_Explain + "\n" + } +) + } + else -> { // BLOCK + val tmp6_Explain: Int = 5 + val tmp7_Explain: Boolean = EQEQ(arg0 = tmp2_Explain, arg1 = tmp6_Explain) + assert(value = tmp7_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert((str?.lowercase()?.length ?: default) == 5)" + "\n | | | |" + "\n | | | " + tmp7_Explain + "\n | | " + tmp2_Explain + "\n | " + tmp1_Explain + "\n " + tmp0_Explain + "\n" + } +) + } + } + } + } +) +} + +fun test2(str: String?, fallback: String?, default: Int): String { + return expectThrowableMessage(block = local fun <anonymous>() { + { // BLOCK + val tmp0_Explain: String? = str + val tmp1_Explain: String? = { // BLOCK + val tmp_2: String? = tmp0_Explain + when { + EQEQ(arg0 = tmp_2, arg1 = null) -> null + else -> lowercase(/* <this> = tmp_2 /*as String */ */) + } + } + when { + EQEQ(arg0 = tmp1_Explain, arg1 = null) -> { // BLOCK + val tmp2_Explain: String? = fallback + val tmp3_Explain: Int? = { // BLOCK + val tmp_3: String? = tmp2_Explain + when { + EQEQ(arg0 = tmp_3, arg1 = null) -> null + else -> tmp_3 /*as String */.<get-length>() + } + } + when { + EQEQ(arg0 = tmp3_Explain, arg1 = null) -> { // BLOCK + val tmp4_Explain: Int = default + val tmp5_Explain: Int = 5 + val tmp6_Explain: Boolean = EQEQ(arg0 = tmp4_Explain, arg1 = tmp5_Explain) + assert(value = tmp6_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert(((str?.lowercase() ?: fallback)?.length ?: default) == 5)" + "\n | | | | | |" + "\n | | | | | " + tmp6_Explain + "\n | | | | " + tmp4_Explain + "\n | | | " + tmp3_Explain + "\n | | " + tmp2_Explain + "\n | " + tmp1_Explain + "\n " + tmp0_Explain + "\n" + } +) + } + else -> { // BLOCK + val tmp7_Explain: Int = 5 + val tmp8_Explain: Boolean = EQEQ(arg0 = tmp3_Explain, arg1 = tmp7_Explain) + assert(value = tmp8_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert(((str?.lowercase() ?: fallback)?.length ?: default) == 5)" + "\n | | | | |" + "\n | | | | " + tmp8_Explain + "\n | | | " + tmp3_Explain + "\n | | " + tmp2_Explain + "\n | " + tmp1_Explain + "\n " + tmp0_Explain + "\n" + } +) + } + } + } + else -> { // BLOCK + val tmp9_Explain: Int? = { // BLOCK + val tmp_4: String? = tmp1_Explain + when { + EQEQ(arg0 = tmp_4, arg1 = null) -> null + else -> tmp_4 /*as String */.<get-length>() + } + } + when { + EQEQ(arg0 = tmp9_Explain, arg1 = null) -> { // BLOCK + val tmp10_Explain: Int = default + val tmp11_Explain: Int = 5 + val tmp12_Explain: Boolean = EQEQ(arg0 = tmp10_Explain, arg1 = tmp11_Explain) + assert(value = tmp12_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert(((str?.lowercase() ?: fallback)?.length ?: default) == 5)" + "\n | | | | |" + "\n | | | | " + tmp12_Explain + "\n | | | " + tmp10_Explain + "\n | | " + tmp9_Explain + "\n | " + tmp1_Explain + "\n " + tmp0_Explain + "\n" + } +) + } + else -> { // BLOCK + val tmp13_Explain: Int = 5 + val tmp14_Explain: Boolean = EQEQ(arg0 = tmp9_Explain, arg1 = tmp13_Explain) + assert(value = tmp14_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert(((str?.lowercase() ?: fallback)?.length ?: default) == 5)" + "\n | | | |" + "\n | | | " + tmp14_Explain + "\n | | " + tmp9_Explain + "\n | " + tmp1_Explain + "\n " + tmp0_Explain + "\n" + } +) + } + } + } + } + } + } +) +} + +fun test3(str: String?): String { + return expectThrowableMessage(block = local fun <anonymous>() { + { // BLOCK + val tmp0_Explain: String? = str + val tmp1_Explain: String? = { // BLOCK + val tmp_5: String? = tmp0_Explain + when { + EQEQ(arg0 = tmp_5, arg1 = null) -> null + else -> lowercase(/* <this> = tmp_5 /*as String */ */) + } + } + val tmp2_Explain: Int? = { // BLOCK + val tmp_6: String? = tmp1_Explain + when { + EQEQ(arg0 = tmp_6, arg1 = null) -> null + else -> tmp_6 /*as String */.<get-length>() + } + } + when { + EQEQ(arg0 = tmp2_Explain, arg1 = null) -> { // BLOCK + val tmp3_Explain: Int = 0 + val tmp4_Explain: Int = 5 + val tmp5_Explain: Boolean = EQEQ(arg0 = tmp3_Explain, arg1 = tmp4_Explain) + assert(value = tmp5_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert((str?.lowercase()?.length ?: 0) == 5)" + "\n | | | |" + "\n | | | " + tmp5_Explain + "\n | | " + tmp2_Explain + "\n | " + tmp1_Explain + "\n " + tmp0_Explain + "\n" + } +) + } + else -> { // BLOCK + val tmp6_Explain: Int = 5 + val tmp7_Explain: Boolean = EQEQ(arg0 = tmp2_Explain, arg1 = tmp6_Explain) + assert(value = tmp7_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert((str?.lowercase()?.length ?: 0) == 5)" + "\n | | | |" + "\n | | | " + tmp7_Explain + "\n | | " + tmp2_Explain + "\n | " + tmp1_Explain + "\n " + tmp0_Explain + "\n" + } +) + } + } + } + } +) +}
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/EnumEntry.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/EnumEntry.noruntime.box.txt new file mode 100644 index 0000000..1b02b86 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/EnumEntry.noruntime.box.txt
@@ -0,0 +1,6 @@ +test1: --- +assert(actual == Planet.Earth) + | | + | false + Pluto +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/IfExpression.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/IfExpression.noruntime.box.txt new file mode 100644 index 0000000..b70920f --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/IfExpression.noruntime.box.txt
@@ -0,0 +1,198 @@ +--- +assert(if (a < b) a == b else if (b < a) b == a else false) + | | | | | | | | | + | | | | | | | | 2 + | | | | | | | false + | | | | | | 1 + | | | | | 2 + | | | | true + | | | 1 + | | 1 + | false + 2 +--- +--- +assert(if (a < b) a == b else if (b < a) b == a else false) + | | | | | | + | | | | | 2 + | | | | false + | | | 1 + | | 2 + | true + 1 +--- +--- +assert(if (a < b) a == b else if (b < a) b == a else false) + | | | | | | + | | | | | 1 + | | | | false + | | | 1 + | | 1 + | false + 1 +--- +--- +assert(a + (if (a < b) a else b) + b == a) + | | | | | | | | | | + | | | | | | | | | 1 + | | | | | | | | false + | | | | | | | 2 + | | | | | | 4 + | | | | | 1 + | | | | 2 + | | | true + | | 1 + | 2 + 1 +--- +--- +assert(a + (if (a < b) a else b) + b == a) + | | | | | | | | | | + | | | | | | | | | 2 + | | | | | | | | false + | | | | | | | 1 + | | | | | | 4 + | | | | | 1 + | | | | 1 + | | | false + | | 2 + | 3 + 2 +--- +--- +assert( + when { + a < b -> a == b + | | | + | | 1 + | false + 2 + + b < a -> b == a + | | | | | | + | | | | | 2 + | | | | false + | | | 1 + | | 2 + | true + 1 + + else -> false + } +) +--- +--- +assert( + when { + a < b -> a == b + | | | | | | + | | | | | 2 + | | | | false + | | | 1 + | | 2 + | true + 1 + + b < a -> b == a + else -> false + } +) +--- +--- +assert( + when { + a < b -> a == b + | | | + | | 1 + | false + 1 + + b < a -> b == a + | | | + | | 1 + | false + 1 + + else -> false + } +) +--- +--- +assert( + initial && when { + | + true + + a < b -> a == b + | | | + | | 1 + | false + 2 + + b < a -> b == a + | | | | | | + | | | | | 2 + | | | | false + | | | 1 + | | 2 + | true + 1 + + else -> false + } +) +--- +--- +assert( + initial && when { + | + true + + a < b -> a == b + | | | | | | + | | | | | 2 + | | | | false + | | | 1 + | | 2 + | true + 1 + + b < a -> b == a + else -> false + } +) +--- +--- +assert( + initial && when { + | + true + + a < b -> a == b + | | | + | | 1 + | false + 1 + + b < a -> b == a + | | | + | | 1 + | false + 1 + + else -> false + } +) +--- +--- +assert( + initial && when { + | + false + + a < b -> a == b + b < a -> b == a + else -> false + } +) +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/IfExpression.noruntime.kt.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/IfExpression.noruntime.kt.txt new file mode 100644 index 0000000..4d1f28e --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/IfExpression.noruntime.kt.txt
@@ -0,0 +1,193 @@ +fun box(): String { + return test1(a = 2, b = 1).plus(other = test1(a = 1, b = 2)).plus(other = test1(a = 1, b = 1)).plus(other = test2(a = 1, b = 2)).plus(other = test2(a = 2, b = 1)).plus(other = test3(a = 2, b = 1)).plus(other = test3(a = 1, b = 2)).plus(other = test3(a = 1, b = 1)).plus(other = test4(initial = true, a = 2, b = 1)).plus(other = test4(initial = true, a = 1, b = 2)).plus(other = test4(initial = true, a = 1, b = 1)).plus(other = test4(initial = false, a = 1, b = 1)) +} + +fun test1(a: Int, b: Int): String { + return expectThrowableMessage(block = local fun <anonymous>() { + { // BLOCK + val tmp0_Explain: Int = a + val tmp1_Explain: Int = b + val tmp2_Explain: Boolean = less(arg0 = tmp0_Explain, arg1 = tmp1_Explain) + when { + tmp2_Explain -> { // BLOCK + val tmp3_Explain: Int = a + val tmp4_Explain: Int = b + val tmp5_Explain: Boolean = EQEQ(arg0 = tmp3_Explain, arg1 = tmp4_Explain) + assert(value = tmp5_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert(if (a < b) a == b else if (b < a) b == a else false)" + "\n | | | | | |" + "\n | | | | | " + tmp4_Explain + "\n | | | | " + tmp5_Explain + "\n | | | " + tmp3_Explain + "\n | | " + tmp1_Explain + "\n | " + tmp2_Explain + "\n " + tmp0_Explain + "\n" + } +) + } + else -> { // BLOCK + val tmp6_Explain: Int = b + val tmp7_Explain: Int = a + val tmp8_Explain: Boolean = less(arg0 = tmp6_Explain, arg1 = tmp7_Explain) + when { + tmp8_Explain -> { // BLOCK + val tmp9_Explain: Int = b + val tmp10_Explain: Int = a + val tmp11_Explain: Boolean = EQEQ(arg0 = tmp9_Explain, arg1 = tmp10_Explain) + assert(value = tmp11_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert(if (a < b) a == b else if (b < a) b == a else false)" + "\n | | | | | | | | |" + "\n | | | | | | | | " + tmp10_Explain + "\n | | | | | | | " + tmp11_Explain + "\n | | | | | | " + tmp9_Explain + "\n | | | | | " + tmp7_Explain + "\n | | | | " + tmp8_Explain + "\n | | | " + tmp6_Explain + "\n | | " + tmp1_Explain + "\n | " + tmp2_Explain + "\n " + tmp0_Explain + "\n" + } +) + } + else -> { // BLOCK + val tmp12_Explain: Boolean = true + val tmp13_Explain: Boolean = false + assert(value = tmp13_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert(if (a < b) a == b else if (b < a) b == a else false)" + "\n | | | | | |" + "\n | | | | | " + tmp7_Explain + "\n | | | | " + tmp8_Explain + "\n | | | " + tmp6_Explain + "\n | | " + tmp1_Explain + "\n | " + tmp2_Explain + "\n " + tmp0_Explain + "\n" + } +) + } + } + } + } + } + } +) +} + +fun test2(a: Int, b: Int): String { + return expectThrowableMessage(block = local fun <anonymous>() { + { // BLOCK + val tmp0_Explain: Int = a + val tmp1_Explain: Int = a + val tmp2_Explain: Int = b + val tmp3_Explain: Boolean = less(arg0 = tmp1_Explain, arg1 = tmp2_Explain) + when { + tmp3_Explain -> { // BLOCK + val tmp4_Explain: Int = a + val tmp5_Explain: Int = tmp0_Explain.plus(other = tmp4_Explain) + val tmp6_Explain: Int = b + val tmp7_Explain: Int = tmp5_Explain.plus(other = tmp6_Explain) + val tmp8_Explain: Int = a + val tmp9_Explain: Boolean = EQEQ(arg0 = tmp7_Explain, arg1 = tmp8_Explain) + assert(value = tmp9_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert(a + (if (a < b) a else b) + b == a)" + "\n | | | | | | | | | |" + "\n | | | | | | | | | " + tmp8_Explain + "\n | | | | | | | | " + tmp9_Explain + "\n | | | | | | | " + tmp6_Explain + "\n | | | | | | " + tmp7_Explain + "\n | | | | | " + tmp4_Explain + "\n | | | | " + tmp2_Explain + "\n | | | " + tmp3_Explain + "\n | | " + tmp1_Explain + "\n | " + tmp5_Explain + "\n " + tmp0_Explain + "\n" + } +) + } + else -> { // BLOCK + val tmp10_Explain: Boolean = true + val tmp11_Explain: Int = b + val tmp12_Explain: Int = tmp0_Explain.plus(other = tmp11_Explain) + val tmp13_Explain: Int = b + val tmp14_Explain: Int = tmp12_Explain.plus(other = tmp13_Explain) + val tmp15_Explain: Int = a + val tmp16_Explain: Boolean = EQEQ(arg0 = tmp14_Explain, arg1 = tmp15_Explain) + assert(value = tmp16_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert(a + (if (a < b) a else b) + b == a)" + "\n | | | | | | | | | |" + "\n | | | | | | | | | " + tmp15_Explain + "\n | | | | | | | | " + tmp16_Explain + "\n | | | | | | | " + tmp13_Explain + "\n | | | | | | " + tmp14_Explain + "\n | | | | | " + tmp11_Explain + "\n | | | | " + tmp2_Explain + "\n | | | " + tmp3_Explain + "\n | | " + tmp1_Explain + "\n | " + tmp12_Explain + "\n " + tmp0_Explain + "\n" + } +) + } + } + } + } +) +} + +fun test3(a: Int, b: Int): String { + return expectThrowableMessage(block = local fun <anonymous>() { + { // BLOCK + val tmp0_Explain: Int = a + val tmp1_Explain: Int = b + val tmp2_Explain: Boolean = less(arg0 = tmp0_Explain, arg1 = tmp1_Explain) + when { + tmp2_Explain -> { // BLOCK + val tmp3_Explain: Int = a + val tmp4_Explain: Int = b + val tmp5_Explain: Boolean = EQEQ(arg0 = tmp3_Explain, arg1 = tmp4_Explain) + assert(value = tmp5_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert(" + "\n when {" + "\n a < b -> a == b" + "\n | | | | | |" + "\n | | | | | " + tmp4_Explain + "\n | | | | " + tmp5_Explain + "\n | | | " + tmp3_Explain + "\n | | " + tmp1_Explain + "\n | " + tmp2_Explain + "\n " + tmp0_Explain + "\n\n b < a -> b == a" + "\n else -> false" + "\n }" + "\n)" + "\n" + } +) + } + else -> { // BLOCK + val tmp6_Explain: Int = b + val tmp7_Explain: Int = a + val tmp8_Explain: Boolean = less(arg0 = tmp6_Explain, arg1 = tmp7_Explain) + when { + tmp8_Explain -> { // BLOCK + val tmp9_Explain: Int = b + val tmp10_Explain: Int = a + val tmp11_Explain: Boolean = EQEQ(arg0 = tmp9_Explain, arg1 = tmp10_Explain) + assert(value = tmp11_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert(" + "\n when {" + "\n a < b -> a == b" + "\n | | |" + "\n | | " + tmp1_Explain + "\n | " + tmp2_Explain + "\n " + tmp0_Explain + "\n\n b < a -> b == a" + "\n | | | | | |" + "\n | | | | | " + tmp10_Explain + "\n | | | | " + tmp11_Explain + "\n | | | " + tmp9_Explain + "\n | | " + tmp7_Explain + "\n | " + tmp8_Explain + "\n " + tmp6_Explain + "\n\n else -> false" + "\n }" + "\n)" + "\n" + } +) + } + else -> { // BLOCK + val tmp12_Explain: Boolean = true + val tmp13_Explain: Boolean = false + assert(value = tmp13_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert(" + "\n when {" + "\n a < b -> a == b" + "\n | | |" + "\n | | " + tmp1_Explain + "\n | " + tmp2_Explain + "\n " + tmp0_Explain + "\n\n b < a -> b == a" + "\n | | |" + "\n | | " + tmp7_Explain + "\n | " + tmp8_Explain + "\n " + tmp6_Explain + "\n\n else -> false" + "\n }" + "\n)" + "\n" + } +) + } + } + } + } + } + } +) +} + +fun test4(initial: Boolean, a: Int, b: Int): String { + return expectThrowableMessage(block = local fun <anonymous>() { + { // BLOCK + val tmp0_Explain: Boolean = initial + when { + tmp0_Explain -> { // BLOCK + val tmp1_Explain: Int = a + val tmp2_Explain: Int = b + val tmp3_Explain: Boolean = less(arg0 = tmp1_Explain, arg1 = tmp2_Explain) + when { + tmp3_Explain -> { // BLOCK + val tmp4_Explain: Int = a + val tmp5_Explain: Int = b + val tmp6_Explain: Boolean = EQEQ(arg0 = tmp4_Explain, arg1 = tmp5_Explain) + assert(value = tmp6_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert(" + "\n initial && when {" + "\n |" + "\n " + tmp0_Explain + "\n\n a < b -> a == b" + "\n | | | | | |" + "\n | | | | | " + tmp5_Explain + "\n | | | | " + tmp6_Explain + "\n | | | " + tmp4_Explain + "\n | | " + tmp2_Explain + "\n | " + tmp3_Explain + "\n " + tmp1_Explain + "\n\n b < a -> b == a" + "\n else -> false" + "\n }" + "\n)" + "\n" + } +) + } + else -> { // BLOCK + val tmp7_Explain: Int = b + val tmp8_Explain: Int = a + val tmp9_Explain: Boolean = less(arg0 = tmp7_Explain, arg1 = tmp8_Explain) + when { + tmp9_Explain -> { // BLOCK + val tmp10_Explain: Int = b + val tmp11_Explain: Int = a + val tmp12_Explain: Boolean = EQEQ(arg0 = tmp10_Explain, arg1 = tmp11_Explain) + assert(value = tmp12_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert(" + "\n initial && when {" + "\n |" + "\n " + tmp0_Explain + "\n\n a < b -> a == b" + "\n | | |" + "\n | | " + tmp2_Explain + "\n | " + tmp3_Explain + "\n " + tmp1_Explain + "\n\n b < a -> b == a" + "\n | | | | | |" + "\n | | | | | " + tmp11_Explain + "\n | | | | " + tmp12_Explain + "\n | | | " + tmp10_Explain + "\n | | " + tmp8_Explain + "\n | " + tmp9_Explain + "\n " + tmp7_Explain + "\n\n else -> false" + "\n }" + "\n)" + "\n" + } +) + } + else -> { // BLOCK + val tmp13_Explain: Boolean = true + val tmp14_Explain: Boolean = false + assert(value = tmp14_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert(" + "\n initial && when {" + "\n |" + "\n " + tmp0_Explain + "\n\n a < b -> a == b" + "\n | | |" + "\n | | " + tmp2_Explain + "\n | " + tmp3_Explain + "\n " + tmp1_Explain + "\n\n b < a -> b == a" + "\n | | |" + "\n | | " + tmp8_Explain + "\n | " + tmp9_Explain + "\n " + tmp7_Explain + "\n\n else -> false" + "\n }" + "\n)" + "\n" + } +) + } + } + } + } + } + else -> { // BLOCK + val tmp15_Explain: Boolean = true + val tmp16_Explain: Boolean = false + assert(value = tmp16_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert(" + "\n initial && when {" + "\n |" + "\n " + tmp0_Explain + "\n\n a < b -> a == b" + "\n b < a -> b == a" + "\n else -> false" + "\n }" + "\n)" + "\n" + } +) + } + } + } + } +) +}
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/expressionWithLabel.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/expressionWithLabel.noruntime.box.txt new file mode 100644 index 0000000..d94fbdd --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/expressionWithLabel.noruntime.box.txt
@@ -0,0 +1,42 @@ +test1: --- +assert(foo@(test?.a ?: true)) + | | + | false + A +--- +test2: --- +assert(foo@(if (a < b) a == b else if (b < a) b == a else false)) + | | | | | | + | | | | | 2 + | | | | false + | | | 1 + | | 2 + | true + 1 +--- +test3: --- +assert(foo@(try { false } catch (e: Exception) { true })) + | + false +--- +test4: --- +assert( + foo@( + when { + x == b -> true + | | | + | | 2 + | false + 1 + + x == a -> false + | | | + | | 1 + | true + 1 + + else -> true + } + ) +) +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/expressionsWithAnnotation.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/expressionsWithAnnotation.noruntime.box.txt new file mode 100644 index 0000000..f91e70f --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/expressionsWithAnnotation.noruntime.box.txt
@@ -0,0 +1,41 @@ +test1: --- +assert(@Ann @AnnWithConstructor(false) test?.a ?: true) + | | + | false + A +--- +test2: --- +assert(@Ann @AnnWithConstructor(true) if (a < b) a == b else if (b < a) b == a else false) + | | | | | | + | | | | | 2 + | | | | false + | | | 1 + | | 2 + | true + 1 +--- +test3: --- +assert(@Ann @AnnWithConstructor(a = true) try { false } catch (e: Exception) { true }) + | + false +--- +test4: --- +assert( + @Ann @AnnWithConstructor(a = true) + when { + x == b -> true + | | | + | | 2 + | false + 1 + + x == a -> false + | | | + | | 1 + | true + 1 + + else -> true + } +) +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/ifWithCodeBlock.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/ifWithCodeBlock.noruntime.box.txt new file mode 100644 index 0000000..52ae29a1 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/ifWithCodeBlock.noruntime.box.txt
@@ -0,0 +1,32 @@ +test1(2, 1): --- +assert(if (a > b) { a == b } else { a.inc() == 3 }) + | | | | + | | | false + | | 1 + | true + 2 +--- +test1(1, 2): --- +assert(if (a > b) { a == b } else { a.inc() == 3 }) + | | | | + | | | false + | | 2 + | false + 1 +--- +test2(1, 2): --- +assert(if (a < b) { if (a > 10) true ; false } else { true }) + | | | | + | | | false + | | 2 + | true + 1 +--- +test3(1, 2): --- +assert(if (a < b) { if (a > 10) true else false } else false) + | | | | + | | | false + | | 2 + | true + 1 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/samInterface.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/samInterface.noruntime.box.txt new file mode 100644 index 0000000..9d52c55 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/samInterface.noruntime.box.txt
@@ -0,0 +1,19 @@ +test1: --- +assert(IntPredicate { it < 0 }.accept(a)) + | | + | 1 + false +--- +test2: --- +assert(IntPredicate { it < 0 }.accept(a) == true) + | | | + | | false + | 1 + false +--- +test3: --- +assert(IntPredicate { it > 0 } plus a) + | | + | -1 + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/stringInterpolation.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/stringInterpolation.noruntime.box.txt new file mode 100644 index 0000000..b572312 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/stringInterpolation.noruntime.box.txt
@@ -0,0 +1,42 @@ +test1: --- +assert("Hello, $a" == "string") + | | | + | | false + | Joe + Hello, Joe +--- +test2: --- +assert("${a.length}" == "5") + | | | | + | | | false + | | 3 + | Joe + 3 +--- +test3: --- +assert("List: $a" == "") + | | | + | | false + | [a, b] + List: [a, b] +--- +test4: --- +assert("Escaping: \$ $a" == "") + | | | + | | false + | Joe + Escaping: $ Joe +--- +test5: --- +assert("""Multiline escaping: ${'$'}_9.99 """ == "price") + | | + | false + Multiline escaping: $_9.99 +--- +test6: --- +assert($$"""Multidollar interpolation $a : $$a""" == "") + | | | + | | false + | Joe + Multidollar interpolation $a : Joe +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/superExpression.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/superExpression.noruntime.box.txt new file mode 100644 index 0000000..9f5e787 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/superExpression.noruntime.box.txt
@@ -0,0 +1,16 @@ +test1: --- +assert(super.a) + | + false +--- +test2: --- +assert(super.b == 2) + | | + | false + 1 +--- +test3: --- +assert(super<Base>.foo()) + | + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/thisExpression.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/thisExpression.noruntime.box.txt new file mode 100644 index 0000000..026a8f6 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/thisExpression.noruntime.box.txt
@@ -0,0 +1,42 @@ +test1: --- +assert(this.a) + | | + | false + A +--- +test2: --- +assert(this.b == 2) + | | | + | | false + | 1 + A +--- +test3: --- +assert(this) + | + false +--- +test4: --- +assert(this == 2) + | | + | false + 1 +--- +test5: --- +assert(this == 2) + | | + | false + 1 +--- +test6: --- +assert(this@A.a) + | | + | false + A +--- +test7: --- +assert(this@lambda == 2) + | | + | false + 1 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/tryCatch.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/tryCatch.noruntime.box.txt new file mode 100644 index 0000000..4e2783e --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/tryCatch.noruntime.box.txt
@@ -0,0 +1,44 @@ +test1: --- +assert(try { false } catch (e: Exception) { true }) + | + false +--- +test2: --- +assert(try { true; a > b } catch (e: NullPointerException) { b > a } catch (e: Exception) { b == a }) + | + false +--- +test3: --- +assert(try { a > b } catch (e: Exception) { b == a } finally { a < b }) + | + false +--- +test4: --- +assert(try { a > b } finally { a == b ; 10}) + | + false +--- +test5: --- +assert(try { a > b } catch (e: Exception) { b == a } finally { a < b } == (a.inc() == 2)) + | | | | | + | | | | true + | | | 2 + | | 1 + | false + false +--- +test6: --- +assert( + try { + | + false + + when { + x == 3 -> true + else -> false + } + } finally { + 1 + } +) +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/whenWithSubject.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/whenWithSubject.noruntime.box.txt new file mode 100644 index 0000000..4a39378 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/whenWithSubject.noruntime.box.txt
@@ -0,0 +1,145 @@ +test1: --- +assert( + when (x) { + | + 2 + + b -> true + | + 3 + + a -> false + | + 2 + + else -> true + } +) +--- +test2: --- +assert( + when (a) { + | + ONE + + A.ONE -> false + A.TWO -> true + } +) +--- +test3: --- +assert( + when (a) { + | + ONE + + A.ONE, A.TWO -> false + } +) +--- +test4: --- +assert( + when (x) { + | + 2 + + a.toInt() -> false + | | + | 2 + 2 + + else -> true + } +) +--- +test5: --- +assert( + when (x) { + | + 2 + + in 1..10 -> x == 3 + | | | | + | | | false + | | 2 + | 1..10 + true + + else -> true + } +) +--- +test6: --- +assert( + when (x) { + | + 2 + + is Int -> x == 3 + | | | + | | false + | 2 + true + + else -> true + } +) +--- +test7: --- +assert( + when (val x = 2) { + in 1..10 -> x == 3 + | | + | 1..10 + true + + else -> true + } +) +--- +test8: --- +assert( + when (x) { + | + 2 + + is Int if x == 1 -> true + | | | + | | false + | 2 + true + + is Int if x == 2 -> false + | | | + | | true + | 2 + true + + else -> true + } +) +--- +test9: --- +assert( + when (val a = x + x + x) { + | | | | | + | | | | 2 + | | | 6 + | | 2 + | 4 + 2 + + x -> true + | + 2 + + x + x -> true + | | | + | | 2 + | 4 + 2 + + else -> false + } +) +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/whenWithoutSubject.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/whenWithoutSubject.noruntime.box.txt new file mode 100644 index 0000000..a258c4a --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/expressions/whenWithoutSubject.noruntime.box.txt
@@ -0,0 +1,100 @@ +test1: --- +assert( + when { + x == b -> true + | | | + | | 3 + | false + 2 + + x == a -> false + | | | + | | 2 + | true + 2 + + else -> true + } +) +--- +test2: --- +assert( + when { + a == A.ONE -> false + | | + | true + ONE + + a == A.TWO -> true + else -> true + } +) +--- +test3: --- +assert( + when { + a == A.ONE || a == A.TWO -> false + | | + | true + ONE + + else -> true + } +) +--- +test4: --- +assert( + when { + x == a.toInt() -> false + | | | | + | | | 2 + | | 2 + | true + 2 + + else -> true + } +) +--- +test5: --- +assert( + when { + x in 1..10 -> x == 3 + | | | | | + | | | | false + | | | 2 + | | 1..10 + | true + 2 + + else -> true + } +) +--- +test6: --- +assert( + when { + x is Int -> x == 3 + | | | | + | | | false + | | 2 + | true + 2 + + else -> true + } +) +--- +test7: --- +assert( + when { + t == Pair(10, 10) -> true + | | | + | | (10, 10) + | false + (1, 2) + + else -> false + } +) +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/format/CarriageReturn.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/format/CarriageReturn.noruntime.box.txt new file mode 100644 index 0000000..85acb95 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/format/CarriageReturn.noruntime.box.txt
@@ -0,0 +1,21 @@ +--- +assert( + listOf("Hello", "World") + | + [Hello, World] + + .map { it.lowercase() } + | + [hello, world] + + .first { it.startsWith("w") } + | + world + + .length == 4 + | | + | false + 5 + +) +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/format/ChainedMultiline.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/format/ChainedMultiline.noruntime.box.txt new file mode 100644 index 0000000..85acb95 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/format/ChainedMultiline.noruntime.box.txt
@@ -0,0 +1,21 @@ +--- +assert( + listOf("Hello", "World") + | + [Hello, World] + + .map { it.lowercase() } + | + [hello, world] + + .first { it.startsWith("w") } + | + world + + .length == 4 + | | + | false + 5 + +) +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/format/Multiline.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/format/Multiline.noruntime.box.txt new file mode 100644 index 0000000..b70f302 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/format/Multiline.noruntime.box.txt
@@ -0,0 +1,27 @@ +--- +assert( + text + | + Hello + + == null || + | + false + + ( + text.length == 5 && + | | | + | | true + | 5 + Hello + + text.lowercase() == text + | | | | + | | | Hello + | | false + | hello + Hello + + ) +) +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/format/Newlines.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/format/Newlines.noruntime.box.txt new file mode 100644 index 0000000..f2355d6 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/format/Newlines.noruntime.box.txt
@@ -0,0 +1,18 @@ +--- +assert((prefixValue + str.substring(0, 8)).length == 0) + | | | | | | + | | | | | false + | | | | 14 + | | | This + Is + | | This + Is + A + Long + Multiple + Line +String + | Hello:This + Is + Hello: +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/format/ReverseIndent.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/format/ReverseIndent.noruntime.box.txt new file mode 100644 index 0000000..25d97c4 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/format/ReverseIndent.noruntime.box.txt
@@ -0,0 +1,27 @@ +--- + assert( + text + | + Hello + + == null || // Intentional blank line + | + false + + ( + text.length == 5 && + | | | + | | true + | 5 + Hello + +text.lowercase() == text +| | | | +| | | Hello +| | false +| hello +Hello + + ) + ) +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/format/Tabs.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/format/Tabs.noruntime.box.txt new file mode 100644 index 0000000..92f69e8 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/format/Tabs.noruntime.box.txt
@@ -0,0 +1,13 @@ +--- +assert( text != null && text .length == 5 && text .lowercase() == text) + | | | | | | | | | + | | | | | | | | Hello + | | | | | | | false + | | | | | | hello + | | | | | Hello + | | | | true + | | | 5 + | | Hello + | true + Hello +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/format/Whitespace.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/format/Whitespace.noruntime.box.txt new file mode 100644 index 0000000..2b80d75d --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/format/Whitespace.noruntime.box.txt
@@ -0,0 +1,13 @@ +--- +assert( text != null && text .length == 5 && text.lowercase() == text) + | | | | | | | | | + | | | | | | | | Hello + | | | | | | | false + | | | | | | hello + | | | | | Hello + | | | | true + | | | 5 + | | Hello + | true + Hello +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/function/InlineFunction.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/function/InlineFunction.noruntime.box.txt new file mode 100644 index 0000000..73544a0 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/function/InlineFunction.noruntime.box.txt
@@ -0,0 +1,5 @@ +test1: --- +assert(run { getFalse() }) + | + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/function/InlineFunction.noruntime.kt.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/function/InlineFunction.noruntime.kt.txt new file mode 100644 index 0000000..bd771aa --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/function/InlineFunction.noruntime.kt.txt
@@ -0,0 +1,26 @@ +fun box(): String { + return runAll(tests = [to<String, Function0<Unit>>(/* <this> = "test1", */ that = local fun <anonymous>() { + test1() + } +)]) +} + +suspend fun getFalse(): Boolean { + return false +} + +fun test1() { + runBlocking<Unit>(block = local suspend fun <anonymous>() { + { // BLOCK + val tmp0_Explain: Boolean = run<Boolean>(block = local fun <anonymous>(): Boolean { + return getFalse() + } +) + assert(value = tmp0_Explain, lazyMessage = local fun <anonymous>(): String { + return "\nassert(run { getFalse() })" + "\n |" + "\n " + tmp0_Explain + "\n" + } +) + } + } +) +}
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/function/anonymousFunction.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/function/anonymousFunction.noruntime.box.txt new file mode 100644 index 0000000..99ac5d2 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/function/anonymousFunction.noruntime.box.txt
@@ -0,0 +1,20 @@ +test1: --- +assert(fun(): Boolean { return false }()) + | + false +--- +test2: --- +assert(fun Int.(): Boolean { return this > 10 }(9)) + | + false +--- +test3: --- +assert(context(a: Int) fun(): Boolean { return a > 10 }(9)) + | + false +--- +test4: --- +assert(fun1@ context(a: Int) fun(): Boolean { return a > 10 }(9)) + | + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/function/functionInCompanion.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/function/functionInCompanion.noruntime.box.txt new file mode 100644 index 0000000..219ddf3 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/function/functionInCompanion.noruntime.box.txt
@@ -0,0 +1,5 @@ +--- +assert(B.foo()) + | + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/function/functionReturnsBoolean.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/function/functionReturnsBoolean.noruntime.box.txt new file mode 100644 index 0000000..b255e33 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/function/functionReturnsBoolean.noruntime.box.txt
@@ -0,0 +1,36 @@ +test1: --- +assert(funWithVararg("a")) + | + false +--- +test2: --- +assert({ false }.funWithExtension()) + | + false +--- +test3: --- +assert(with(false) { funWithContext() }) + | + false +--- +test4: --- +assert(funWithTypeParameter()) + | + false +--- +test5: --- +assert(funWithInline { false }) + | + false +--- +test6: --- +assert(local()) + | + false +--- +test7: --- +assert(funWithNotPrimitiveParameter(1, A())) + | | + | A + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchContextInfix.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchContextInfix.noruntime.box.txt new file mode 100644 index 0000000..ed4a31c --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchContextInfix.noruntime.box.txt
@@ -0,0 +1,62 @@ +test1: --- +Wrapper(2) mustEqual 6 +| +Wrapper +--- +test2: --- +Wrapper(1) mustEqual (2 + 4) +| | +| 6 +Wrapper +--- +test3: --- +Wrapper(1 + 1) mustEqual 6 +| | +| 2 +Wrapper +--- +test4: --- +Wrapper(1 + 1) mustEqual (2 + 4) +| | | +| | 6 +| 2 +Wrapper +--- +test5: --- +Complex.holder.wrapper mustEqual "world".length + | | | + | | 5 + | Wrapper + Holder(wrapper=Wrapper) +--- +test6: --- +Wrapper(2).mustEqual(6) +| +Wrapper +--- +test7: --- +Wrapper(1).mustEqual(2 + 4) +| | +| 6 +Wrapper +--- +test8: --- +Wrapper(1 + 1).mustEqual(6) +| | +| 2 +Wrapper +--- +test9: --- +Wrapper(1 + 1).mustEqual(2 + 4) +| | | +| | 6 +| 2 +Wrapper +--- +test10: --- +Complex.holder.wrapper.mustEqual("world".length) + | | | + | | 5 + | Wrapper + Holder(wrapper=Wrapper) +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchExtensionContextInfix.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchExtensionContextInfix.noruntime.box.txt new file mode 100644 index 0000000..fb985ac --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchExtensionContextInfix.noruntime.box.txt
@@ -0,0 +1,48 @@ +test1: ---Assertion failed--- +test2: --- +1 mustEqual (2 + 4) + | + 6 +--- +test3: --- +(1 + 1) mustEqual 6 + | + 2 +--- +test4: --- +(1 + 1) mustEqual (2 + 4) + | | + | 6 + 2 +--- +test5: --- +"hello".substring(1, 4).length mustEqual "world".length + | | | + | | 5 + | 3 + ell +--- +test6: ---Assertion failed--- +test7: --- +1.mustEqual(2 + 4) + | + 6 +--- +test8: --- +(1 + 1).mustEqual(6) + | + 2 +--- +test9: --- +(1 + 1).mustEqual(2 + 4) + | | + | 6 + 2 +--- +test10: --- +"hello".substring(1, 4).length.mustEqual("world".length) + | | | + | | 5 + | 3 + ell +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchExtensionInfix.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchExtensionInfix.noruntime.box.txt new file mode 100644 index 0000000..fb985ac --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchExtensionInfix.noruntime.box.txt
@@ -0,0 +1,48 @@ +test1: ---Assertion failed--- +test2: --- +1 mustEqual (2 + 4) + | + 6 +--- +test3: --- +(1 + 1) mustEqual 6 + | + 2 +--- +test4: --- +(1 + 1) mustEqual (2 + 4) + | | + | 6 + 2 +--- +test5: --- +"hello".substring(1, 4).length mustEqual "world".length + | | | + | | 5 + | 3 + ell +--- +test6: ---Assertion failed--- +test7: --- +1.mustEqual(2 + 4) + | + 6 +--- +test8: --- +(1 + 1).mustEqual(6) + | + 2 +--- +test9: --- +(1 + 1).mustEqual(2 + 4) + | | + | 6 + 2 +--- +test10: --- +"hello".substring(1, 4).length.mustEqual("world".length) + | | | + | | 5 + | 3 + ell +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchInfix.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchInfix.noruntime.box.txt new file mode 100644 index 0000000..6f6b987 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchInfix.noruntime.box.txt
@@ -0,0 +1,7 @@ +--- +Wrapper(1 + 1) mustEqual (2 + 4) +| | | +| | 6 +| 2 +Wrapper +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchInfixComplexReceiver.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchInfixComplexReceiver.noruntime.box.txt new file mode 100644 index 0000000..06f3227 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchInfixComplexReceiver.noruntime.box.txt
@@ -0,0 +1,7 @@ +--- +Complex.holder.wrapper mustEqual "world".length + | | | + | | 5 + | Wrapper + Holder(wrapper=Wrapper) +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchInfixConstantParameter.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchInfixConstantParameter.noruntime.box.txt new file mode 100644 index 0000000..86db1a4 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchInfixConstantParameter.noruntime.box.txt
@@ -0,0 +1,6 @@ +--- +Wrapper(1 + 1) mustEqual 6 +| | +| 2 +Wrapper +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchInfixConstantReceiver.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchInfixConstantReceiver.noruntime.box.txt new file mode 100644 index 0000000..a63ed45 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchInfixConstantReceiver.noruntime.box.txt
@@ -0,0 +1,6 @@ +--- +Wrapper(1) mustEqual (2 + 4) +| | +| 6 +Wrapper +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchInfixOnlyConstants.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchInfixOnlyConstants.noruntime.box.txt new file mode 100644 index 0000000..4f00377 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchInfixOnlyConstants.noruntime.box.txt
@@ -0,0 +1,5 @@ +--- +Wrapper(2) mustEqual 6 +| +Wrapper +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchNonInfix.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchNonInfix.noruntime.box.txt new file mode 100644 index 0000000..fb8e1f1 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchNonInfix.noruntime.box.txt
@@ -0,0 +1,7 @@ +--- +Wrapper(1 + 1).mustEqual(2 + 4) +| | | +| | 6 +| 2 +Wrapper +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchNonInfixComplexReceiver.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchNonInfixComplexReceiver.noruntime.box.txt new file mode 100644 index 0000000..2afd86f --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchNonInfixComplexReceiver.noruntime.box.txt
@@ -0,0 +1,7 @@ +--- +Complex.holder.wrapper.mustEqual("world".length) + | | | + | | 5 + | Wrapper + Holder(wrapper=Wrapper) +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchNonInfixConstantParameter.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchNonInfixConstantParameter.noruntime.box.txt new file mode 100644 index 0000000..a78b01dc --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchNonInfixConstantParameter.noruntime.box.txt
@@ -0,0 +1,6 @@ +--- +Wrapper(1 + 1).mustEqual(6) +| | +| 2 +Wrapper +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchNonInfixConstantReceiver.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchNonInfixConstantReceiver.noruntime.box.txt new file mode 100644 index 0000000..2819b73 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchNonInfixConstantReceiver.noruntime.box.txt
@@ -0,0 +1,6 @@ +--- +Wrapper(1).mustEqual(2 + 4) +| | +| 6 +Wrapper +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchNonInfixOnlyConstants.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchNonInfixOnlyConstants.noruntime.box.txt new file mode 100644 index 0000000..95f7c0c --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/DispatchNonInfixOnlyConstants.noruntime.box.txt
@@ -0,0 +1,5 @@ +--- +Wrapper(2).mustEqual(6) +| +Wrapper +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionContextInfix.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionContextInfix.noruntime.box.txt new file mode 100644 index 0000000..fb985ac --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionContextInfix.noruntime.box.txt
@@ -0,0 +1,48 @@ +test1: ---Assertion failed--- +test2: --- +1 mustEqual (2 + 4) + | + 6 +--- +test3: --- +(1 + 1) mustEqual 6 + | + 2 +--- +test4: --- +(1 + 1) mustEqual (2 + 4) + | | + | 6 + 2 +--- +test5: --- +"hello".substring(1, 4).length mustEqual "world".length + | | | + | | 5 + | 3 + ell +--- +test6: ---Assertion failed--- +test7: --- +1.mustEqual(2 + 4) + | + 6 +--- +test8: --- +(1 + 1).mustEqual(6) + | + 2 +--- +test9: --- +(1 + 1).mustEqual(2 + 4) + | | + | 6 + 2 +--- +test10: --- +"hello".substring(1, 4).length.mustEqual("world".length) + | | | + | | 5 + | 3 + ell +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionInfix.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionInfix.noruntime.box.txt new file mode 100644 index 0000000..552b6e5 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionInfix.noruntime.box.txt
@@ -0,0 +1,6 @@ +--- +(1 + 1) mustEqual (2 + 4) + | | + | 6 + 2 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionInfixComplexReceiver.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionInfixComplexReceiver.noruntime.box.txt new file mode 100644 index 0000000..664741d --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionInfixComplexReceiver.noruntime.box.txt
@@ -0,0 +1,7 @@ +--- +"hello".substring(1, 4).length mustEqual "world".length + | | | + | | 5 + | 3 + ell +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionInfixConstantParameter.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionInfixConstantParameter.noruntime.box.txt new file mode 100644 index 0000000..61ca86d --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionInfixConstantParameter.noruntime.box.txt
@@ -0,0 +1,5 @@ +--- +(1 + 1) mustEqual 6 + | + 2 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionInfixConstantReceiver.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionInfixConstantReceiver.noruntime.box.txt new file mode 100644 index 0000000..df1505b --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionInfixConstantReceiver.noruntime.box.txt
@@ -0,0 +1,5 @@ +--- +1 mustEqual (2 + 4) + | + 6 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionInfixOnlyConstants.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionInfixOnlyConstants.noruntime.box.txt new file mode 100644 index 0000000..b097f71 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionInfixOnlyConstants.noruntime.box.txt
@@ -0,0 +1 @@ +---Assertion failed---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionNonInfix.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionNonInfix.noruntime.box.txt new file mode 100644 index 0000000..559d5d3 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionNonInfix.noruntime.box.txt
@@ -0,0 +1,6 @@ +--- +(1 + 1).mustEqual(2 + 4) + | | + | 6 + 2 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionNonInfixComplexReceiver.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionNonInfixComplexReceiver.noruntime.box.txt new file mode 100644 index 0000000..b4f16b9 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionNonInfixComplexReceiver.noruntime.box.txt
@@ -0,0 +1,7 @@ +--- +"hello".substring(1, 4).length.mustEqual("world".length) + | | | + | | 5 + | 3 + ell +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionNonInfixConstantParameter.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionNonInfixConstantParameter.noruntime.box.txt new file mode 100644 index 0000000..ae84466 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionNonInfixConstantParameter.noruntime.box.txt
@@ -0,0 +1,5 @@ +--- +(1 + 1).mustEqual(6) + | + 2 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionNonInfixConstantReceiver.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionNonInfixConstantReceiver.noruntime.box.txt new file mode 100644 index 0000000..c904f13 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionNonInfixConstantReceiver.noruntime.box.txt
@@ -0,0 +1,5 @@ +--- +1.mustEqual(2 + 4) + | + 6 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionNonInfixOnlyConstants.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionNonInfixOnlyConstants.noruntime.box.txt new file mode 100644 index 0000000..b097f71 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/ExtensionNonInfixOnlyConstants.noruntime.box.txt
@@ -0,0 +1 @@ +---Assertion failed---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/RegexFunction.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/RegexFunction.noruntime.box.txt new file mode 100644 index 0000000..3d09257 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/RegexFunction.noruntime.box.txt
@@ -0,0 +1,6 @@ +--- +assert("Hello, World".matches("[A-Za-z]+".toRegex())) + | | + | [A-Za-z]+ + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/infix/RegexInfix.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/RegexInfix.noruntime.box.txt new file mode 100644 index 0000000..a31dbdf --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/infix/RegexInfix.noruntime.box.txt
@@ -0,0 +1,6 @@ +--- +assert("Hello, World" matches "[A-Za-z]+".toRegex()) + | | + | [A-Za-z]+ + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/junit5/JunitAssertTrue.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/junit5/JunitAssertTrue.noruntime.box.txt new file mode 100644 index 0000000..62aaa72 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/junit5/JunitAssertTrue.noruntime.box.txt
@@ -0,0 +1,5 @@ +--- +assertTrue(1 != 1) + | + false + ==> expected: <true> but was: <false>---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/junit5/JunitAssertTrue.noruntime.kt.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/junit5/JunitAssertTrue.noruntime.kt.txt new file mode 100644 index 0000000..3c95956 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/junit5/JunitAssertTrue.noruntime.kt.txt
@@ -0,0 +1,14 @@ +fun box(): String { + return expectThrowableMessage(block = local fun <anonymous>() { + { // BLOCK + val tmp0_Explain: Int = 1 + val tmp1_Explain: Int = 1 + val tmp2_Explain: Boolean = EQEQ(arg0 = tmp0_Explain, arg1 = tmp1_Explain).not() + assertTrue(condition = tmp2_Explain, messageSupplier = local fun <anonymous>(): String { + return "\nassertTrue(1 != 1)" + "\n |" + "\n " + tmp2_Explain + "\n" + } + /*-> @FlexibleNullability Supplier<@FlexibleNullability String?>? */) + } + } +) +}
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/junit5/JunitAssertTrueMessage.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/junit5/JunitAssertTrueMessage.noruntime.box.txt new file mode 100644 index 0000000..c95c6b2 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/junit5/JunitAssertTrueMessage.noruntime.box.txt
@@ -0,0 +1,5 @@ +---Message: +assertTrue(1 != 1, "Message:") + | + false + ==> expected: <true> but was: <false>---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/junit5/JunitAssertTrueMessageSupplier.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/junit5/JunitAssertTrueMessageSupplier.noruntime.box.txt new file mode 100644 index 0000000..b632eb3 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/junit5/JunitAssertTrueMessageSupplier.noruntime.box.txt
@@ -0,0 +1,5 @@ +---Message: +assertTrue(1 != 1) { "Message:" } + | + false + ==> expected: <true> but was: <false>---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/junit5/JunitAssertTrueMessageSupplierVariable.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/junit5/JunitAssertTrueMessageSupplierVariable.noruntime.box.txt new file mode 100644 index 0000000..34e314f --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/junit5/JunitAssertTrueMessageSupplierVariable.noruntime.box.txt
@@ -0,0 +1,5 @@ +---Message: +assertTrue(1 != 1, supplier) + | + false + ==> expected: <true> but was: <false>---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/junit5/JunitAssertTrueMessageVariable.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/junit5/JunitAssertTrueMessageVariable.noruntime.box.txt new file mode 100644 index 0000000..ee27f38 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/junit5/JunitAssertTrueMessageVariable.noruntime.box.txt
@@ -0,0 +1,5 @@ +---Message: +assertTrue(1 != 1, message) + | + false + ==> expected: <true> but was: <false>---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertEquals.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertEquals.noruntime.box.txt new file mode 100644 index 0000000..c108cd0 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertEquals.noruntime.box.txt
@@ -0,0 +1,6 @@ +--- +assertEquals(greeting, name) + | | + | World + Hello +. Expected <Hello>, actual <World>.---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertEqualsMessage.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertEqualsMessage.noruntime.box.txt new file mode 100644 index 0000000..d735464 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertEqualsMessage.noruntime.box.txt
@@ -0,0 +1,6 @@ +---Message: +assertEquals(greeting, name, "Message:") + | | + | World + Hello +. Expected <Hello>, actual <World>.---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertEqualsMessageVariable.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertEqualsMessageVariable.noruntime.box.txt new file mode 100644 index 0000000..36dc76a --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertEqualsMessageVariable.noruntime.box.txt
@@ -0,0 +1,6 @@ +---Message: +assertEquals(greeting, name, message) + | | + | World + Hello +. Expected <Hello>, actual <World>.---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertFalse.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertFalse.noruntime.box.txt new file mode 100644 index 0000000..b238dc1 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertFalse.noruntime.box.txt
@@ -0,0 +1,5 @@ +--- +assertFalse(1 == 1) + | + true +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertFalseMessage.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertFalseMessage.noruntime.box.txt new file mode 100644 index 0000000..48c3429 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertFalseMessage.noruntime.box.txt
@@ -0,0 +1,5 @@ +---Message: +assertFalse(1 == 1, "Message:") + | + true +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertFalseMessageVariable.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertFalseMessageVariable.noruntime.box.txt new file mode 100644 index 0000000..28624c6 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertFalseMessageVariable.noruntime.box.txt
@@ -0,0 +1,5 @@ +---Message: +assertFalse(1 == 1, message) + | + true +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertNotNull.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertNotNull.noruntime.box.txt new file mode 100644 index 0000000..9aaaf53 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertNotNull.noruntime.box.txt
@@ -0,0 +1,5 @@ +--- +assertNotNull(name) + | + null +. Expected value to be not null.---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertNotNullMessage.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertNotNullMessage.noruntime.box.txt new file mode 100644 index 0000000..c071a78 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertNotNullMessage.noruntime.box.txt
@@ -0,0 +1,5 @@ +---Message: +assertNotNull(name, "Message:") + | + null +. Expected value to be not null.---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertNotNullMessageVariable.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertNotNullMessageVariable.noruntime.box.txt new file mode 100644 index 0000000..22bc562 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertNotNullMessageVariable.noruntime.box.txt
@@ -0,0 +1,5 @@ +---Message: +assertNotNull(name, message) + | + null +. Expected value to be not null.---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertTrue.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertTrue.noruntime.box.txt new file mode 100644 index 0000000..a48835b --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertTrue.noruntime.box.txt
@@ -0,0 +1,5 @@ +--- +assertTrue(1 != 1) + | + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertTrueMessage.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertTrueMessage.noruntime.box.txt new file mode 100644 index 0000000..4039e484 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertTrueMessage.noruntime.box.txt
@@ -0,0 +1,5 @@ +---Message: +assertTrue(1 != 1, "Message:") + | + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertTrueMessageVariable.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertTrueMessageVariable.noruntime.box.txt new file mode 100644 index 0000000..692d61e --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/kotlin-test/AssertTrueMessageVariable.noruntime.box.txt
@@ -0,0 +1,5 @@ +---Message: +assertTrue(1 != 1, message) + | + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/lambda/AnonymousObject.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/lambda/AnonymousObject.noruntime.box.txt new file mode 100644 index 0000000..b3809fc --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/lambda/AnonymousObject.noruntime.box.txt
@@ -0,0 +1,21 @@ +test1: --- +assert(object { override fun toString() = "ANONYMOUS" }.toString() == "toString()") + | | + | false + ANONYMOUS +--- +test2: --- +assert(object : A() { + fun foo(): Boolean { + return a > b + } +}.foo()) + | + false +--- +test3: --- +assert(valueObject.booleanFunction()) + | | + | false + ANONYMOUS +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/lambda/ListOperationsAssert.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/lambda/ListOperationsAssert.noruntime.box.txt new file mode 100644 index 0000000..82be052 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/lambda/ListOperationsAssert.noruntime.box.txt
@@ -0,0 +1,7 @@ +--- +assert(list.map { "Doe, $it" }.any { it == "Scott, Michael" }) + | | | + | | false + | [Doe, Jane, Doe, John] + [Jane, John] +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/lambda/ListOperationsRequire.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/lambda/ListOperationsRequire.noruntime.box.txt new file mode 100644 index 0000000..1859949 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/lambda/ListOperationsRequire.noruntime.box.txt
@@ -0,0 +1,16 @@ +--- +require( + value = list + | + [Jane, John] + + .map { "Doe, $it" } + | + [Doe, Jane, Doe, John] + + .any { it == "Scott, Michael" } + | + false + +) +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/lambda/lambdaExpression.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/lambda/lambdaExpression.noruntime.box.txt new file mode 100644 index 0000000..c9d4c32 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/lambda/lambdaExpression.noruntime.box.txt
@@ -0,0 +1,21 @@ +test1: --- +assert({ false }()) + | + false +--- +test2: --- +assert({ a: Int -> a > 10 }(9)) + | + false +--- +test3: --- +assert(fun1@ { a: Int -> a > 10 }(9)) + | + false +--- +test4: --- +assert(fun1@ { a: Int -> a > 10 }(9) == true) + | | + | false + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/nullsafe/AssertionOperator.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/nullsafe/AssertionOperator.noruntime.box.txt new file mode 100644 index 0000000..43807c6 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/nullsafe/AssertionOperator.noruntime.box.txt
@@ -0,0 +1,35 @@ +test1: --- +assert(a!!) + | + false +--- +test2: --- +assert(a!!.length == 5) + | | | + | | false + | 4 + test +--- +test3: --- +assert(a.value!!.length == 5) + | | | | + | | | false + | | 4 + | Test + Holder +--- +test4: --- +assert(a["a"]!! == 43) + || | + || false + |42 + {a=42} +--- +test5: --- +assert(a!!.next!!.next != null) + | | | | + | | | false + | | null + | Node + Node +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/nullsafe/ConditionalAccess.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/nullsafe/ConditionalAccess.noruntime.box.txt new file mode 100644 index 0000000..02c66f4 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/nullsafe/ConditionalAccess.noruntime.box.txt
@@ -0,0 +1,8 @@ +--- +assert(text?.length?.minus(2) == 1) + | | | | + | | | false + | | 3 + | 5 + Hello +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/nullsafe/thisSafeCall.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/nullsafe/thisSafeCall.noruntime.box.txt new file mode 100644 index 0000000..c72c78c --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/nullsafe/thisSafeCall.noruntime.box.txt
@@ -0,0 +1,14 @@ +"abc".test1: --- +assert(this?.length == 5) + | | | + | | false + | 3 + abc +--- +null.test1: --- +assert(this?.length == 5) + | | | + | | false + | null + null +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/operator/BitwiseOperators.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/BitwiseOperators.noruntime.box.txt new file mode 100644 index 0000000..3f60d76 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/BitwiseOperators.noruntime.box.txt
@@ -0,0 +1,44 @@ +test1: --- +assert(true and false) + | + false +--- +test2: --- +assert(a and b == 0b10110) + | | | | + | | | false + | | 30 + | 18 + 19 +--- +test3: --- +assert(a or b == 0b10110) + | | | | + | | | false + | | 30 + | 31 + 19 +--- +test4: --- +assert(a xor b == 0b10110) + | | | | + | | | false + | | 30 + | 13 + 19 +--- +test5: --- +assert(5 and 3 + 4 or 1 == 9) + | | | | + | | | false + | | 5 + | 7 + 5 +--- +test6: --- +assert(x ?: 2 and 1 == 1) + | | | + | | false + | 0 + null +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/operator/BitwiseShiftsOperators.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/BitwiseShiftsOperators.noruntime.box.txt new file mode 100644 index 0000000..8663636 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/BitwiseShiftsOperators.noruntime.box.txt
@@ -0,0 +1,35 @@ +test1: --- +assert(0b110011 shl 2 == 0b11011100) + | | + | false + 204 +--- +test2: --- +assert(a shr b == 0b10110) + | | | | + | | | false + | | 30 + | 0 + 19 +--- +test3: --- +assert(-0b1100110011 ushr 22 == 0b1111110111) + | | + | false + 1023 +--- +test4: --- +assert(5 shl 3 + 4 shr 1 == 9) + | | | | + | | | false + | | 320 + | 7 + 640 +--- +test5: --- +assert(x ?: 2 shl 1 == 1) + | | | + | | false + | 4 + null +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/operator/CompareOperator.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/CompareOperator.noruntime.box.txt new file mode 100644 index 0000000..0f486dc --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/CompareOperator.noruntime.box.txt
@@ -0,0 +1,51 @@ +test1: --- +assert("aaa".compareTo("bbb") > 0) + | | + | false + -1 +--- +test2: --- +assert("aaa" > "bbb") + | + false +--- +test3: --- +assert("aaa".compareTo("bbb") >= 0) + | | + | false + -1 +--- +test4: --- +assert("aaa" >= "bbb") + | + false +--- +test5: --- +assert("bbb".compareTo("aaa") < 0) + | | + | false + 1 +--- +test6: --- +assert("bbb" < "aaa") + | + false +--- +test7: --- +assert("bbb".compareTo("aaa") <= 0) + | | + | false + 1 +--- +test8: --- +assert("bbb" <= "aaa") + | + false +--- +test9: --- +assert(("aa" < "a") > ("aa" > "bb")) + | | | + | | false + | false + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/operator/ContainsFunction.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/ContainsFunction.noruntime.box.txt new file mode 100644 index 0000000..02e4189 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/ContainsFunction.noruntime.box.txt
@@ -0,0 +1,30 @@ +test1: --- +assert(listOf("Hello", "World").contains("Name")) + | | + | false + [Hello, World] +--- +test2: --- +assert("Hello".contains(str)) + | | + | a + false +--- +test3: --- +assert("Hello".contains(str, ignoreCase = true)) + | | + | a + false +--- +test4: --- +assert("Hello".contains(char)) + | | + | a + false +--- +test5: --- +assert("Hello".contains(char, ignoreCase = true)) + | | + | a + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/operator/ContainsOperator.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/ContainsOperator.noruntime.box.txt new file mode 100644 index 0000000..f2ebf13 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/ContainsOperator.noruntime.box.txt
@@ -0,0 +1,52 @@ +test1: --- +assert("Name" in listOf("Hello", "World")) + | | + | [Hello, World] + false +--- +test2: --- +assert(" in " in listOf("Hello", "World")) + | | + | [Hello, World] + false +--- +test3: --- +assert( + " in " + + in + | + false + + listOf("Hello", "World") + | + [Hello, World] + +) +--- +test4: --- +assert("Name"/*in*/in/*in*/listOf("Hello", "World")) + | | + | [Hello, World] + false +--- +test5: --- +assert(("Name" in listOf("Hello", "World")) in listOf(true)) + | | | | + | | | [true] + | | false + | [Hello, World] + false +--- +test6: --- +assert(str in "Hello") + | | + | false + a +--- +test7: --- +assert(char in "Hello") + | | + | false + a +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/operator/ContainsWithRange.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/ContainsWithRange.noruntime.box.txt new file mode 100644 index 0000000..4c63992 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/ContainsWithRange.noruntime.box.txt
@@ -0,0 +1,62 @@ +test1: --- +assert(a in 1..9) + | | | + | | 1..9 + | false + 10 +--- +test2: --- +assert(a in 1..<4) + | | | + | | 1..3 + | false + 4 +--- +test3: --- +assert(a in 4 downTo 1) + | | | + | | 4 downTo 1 step 1 + | false + 5 +--- +test4: --- +assert(a in 0..8 step 2) + | | | | + | | | 0..8 step 2 + | | 0..8 + | false + 1 +--- +test5: --- +assert(a in 0..<8 step 2) + | | | | + | | | 0..6 step 2 + | | 0..7 + | false + 7 +--- +test6: --- +assert(a in 8 downTo 0 step 2) + | | | | + | | | 8 downTo 0 step 2 + | | 8 downTo 0 step 1 + | false + 7 +--- +test7: --- +assert(a in (1..10).filter { it % 2 == 0 }) + | | | | + | | | [2, 4, 6, 8, 10] + | | 1..10 + | false + 3 +--- +test8: --- +assert(a in {a: Int -> a}(1)..{a: Int -> a}(5)) + | | | | | + | | | | 5 + | | | 1..5 + | | 1 + | false + 10 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/operator/ExcleqOperator.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/ExcleqOperator.noruntime.box.txt new file mode 100644 index 0000000..dd797d6 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/ExcleqOperator.noruntime.box.txt
@@ -0,0 +1,32 @@ +--- +assert(1 != 1) + | + false +--- +--- +assert(" != " != " != ") + | + false +--- +--- +assert( + " != " + + != + | + false + + " != " +) +--- +--- +assert(1/*!=*/!=/*!=*/1) + | + false +--- +--- +assert((1 != 1) != false) + | | + | false + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/operator/ExcleqeqOperator.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/ExcleqeqOperator.noruntime.box.txt new file mode 100644 index 0000000..e6fd19c --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/ExcleqeqOperator.noruntime.box.txt
@@ -0,0 +1,32 @@ +--- +assert(1 !== 1) + | + false +--- +--- +assert(" !== " !== " !== ") + | + false +--- +--- +assert( + " !== " + + !== + | + false + + " !== " +) +--- +--- +assert(1/*!==*/!==/*!==*/1) + | + false +--- +--- +assert((1 !== 1) !== false) + | | + | false + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/operator/GetOperator.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/GetOperator.noruntime.box.txt new file mode 100644 index 0000000..2b730a9 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/GetOperator.noruntime.box.txt
@@ -0,0 +1,28 @@ +test1: --- +assert(listOf("Hello", "World")[1] == "Hello") + | | | + | | false + | World + [Hello, World] +--- +test2: --- +assert(listOf("Hello", "World").get(1) == "Hello") + | | | + | | false + | World + [Hello, World] +--- +test3: --- +assert(map["key3"] == 300) + | | | + | | false + | null + {key1=100, key2=200} +--- +test4: --- +assert(matrix[0, 1] == 99) + | | | + | | false + | 2 + [[1, 2, 3]] +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/operator/NegativeContainsFunction.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/NegativeContainsFunction.noruntime.box.txt new file mode 100644 index 0000000..bdfa9b9 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/NegativeContainsFunction.noruntime.box.txt
@@ -0,0 +1,7 @@ +--- +assert(!listOf("Hello", "World").contains("Hello")) + || | + || true + |[Hello, World] + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/operator/NegativeContainsOperator.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/NegativeContainsOperator.noruntime.box.txt new file mode 100644 index 0000000..d37772b --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/NegativeContainsOperator.noruntime.box.txt
@@ -0,0 +1,40 @@ +--- +assert("Hello" !in listOf("Hello", "World")) + | | + | [Hello, World] + false +--- +--- +assert(" !in " !in listOf(" !in ")) + | | + | [ !in ] + false +--- +--- +assert( + " !in " + + !in + | + false + + listOf(" !in ") + | + [ !in ] + +) +--- +--- +assert("Hello"/*!in*/!in/*!in*/listOf("Hello", "World")) + | | + | [Hello, World] + false +--- +--- +assert(("Hello" !in listOf("Hello", "World")) !in listOf(false)) + | | | | + | | | [false] + | | false + | [Hello, World] + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/operator/OperatorReceiver.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/OperatorReceiver.noruntime.box.txt new file mode 100644 index 0000000..8750590 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/OperatorReceiver.noruntime.box.txt
@@ -0,0 +1,270 @@ +test1: --- +assert(dispatch + dispatch == Failure) + | | | | + | | | false + | | Dispatch(n=1) + | Dispatch(n=2) + Dispatch(n=1) +--- +test2: --- +assert(extension + extension == Failure) + | | | | + | | | false + | | Extension(n=1) + | Extension(n=2) + Extension(n=1) +--- +test3: --- +assert(extension - extension == Failure) + | | | | + | | | false + | | Extension(n=1) + | Extension(n=0) + Extension(n=1) +--- +test4: --- +assert(dispatch - dispatch == Failure) + | | | | + | | | false + | | Dispatch(n=1) + | Dispatch(n=0) + Dispatch(n=1) +--- +test5: --- +assert(dispatch - dispatch == Failure) + | | | | + | | | false + | | Dispatch(n=1) + | Dispatch(n=0) + Dispatch(n=1) +--- +test6: --- +assert(extension - extension == Failure) + | | | | + | | | false + | | Extension(n=1) + | Extension(n=2) + Extension(n=1) +--- +test7: --- +assert(extension - extension == Failure) + | | | | + | | | false + | | Extension(n=1) + | Extension(n=2) + Extension(n=1) +--- +test8: --- +assert(extension * extension == Failure) + | | | | + | | | false + | | Extension(n=1) + | Extension(n=1) + Extension(n=1) +--- +test9: --- +assert(extension * extension == Failure) + | | | | + | | | false + | | Extension(n=1) + | Extension(n=1) + Extension(n=1) +--- +test10: --- +assert(dispatch in dispatch) + | | | + | | Dispatch(n=1) + | false + Dispatch(n=1) +--- +test11: --- +assert(dispatch in extension) + | | | + | | Extension(n=1) + | false + Dispatch(n=1) +--- +test12: --- +assert(extension in extension) + | | | + | | Extension(n=1) + | false + Extension(n=1) +--- +test13: --- +assert(context in dispatch) + | | | + | | Dispatch(n=1) + | false + Context(n=1) +--- +test14: --- +assert(context in dispatch) + | | | + | | Dispatch(n=1) + | false + Context(n=1) +--- +test15: --- +assert(dispatch in extension) + | | | + | | Extension(n=1) + | false + Dispatch(n=1) +--- +test16: --- +assert(dispatch in extension) + | | | + | | Extension(n=1) + | false + Dispatch(n=1) +--- +test17: --- +assert(context in extension) + | | | + | | Extension(n=1) + | false + Context(n=1) +--- +test18: --- +assert(context in extension) + | | | + | | Extension(n=1) + | false + Context(n=1) +--- +test19: --- +assert(dispatch.plus(dispatch) == Failure) + | | | | + | | | false + | | Dispatch(n=1) + | Dispatch(n=2) + Dispatch(n=1) +--- +test20: --- +assert(extension.plus(extension) == Failure) + | | | | + | | | false + | | Extension(n=1) + | Extension(n=2) + Extension(n=1) +--- +test21: --- +assert(extension.minus(extension) == Failure) + | | | | + | | | false + | | Extension(n=1) + | Extension(n=0) + Extension(n=1) +--- +test22: --- +assert(dispatch.minus(dispatch) == Failure) + | | | | + | | | false + | | Dispatch(n=1) + | Dispatch(n=0) + Dispatch(n=1) +--- +test23: --- +assert(dispatch.minus(dispatch) == Failure) + | | | | + | | | false + | | Dispatch(n=1) + | Dispatch(n=0) + Dispatch(n=1) +--- +test24: --- +assert(extension.minus(extension) == Failure) + | | | | + | | | false + | | Extension(n=1) + | Extension(n=2) + Extension(n=1) +--- +test25: --- +assert(extension.minus(extension) == Failure) + | | | | + | | | false + | | Extension(n=1) + | Extension(n=2) + Extension(n=1) +--- +test26: --- +assert(extension.times(extension) == Failure) + | | | | + | | | false + | | Extension(n=1) + | Extension(n=1) + Extension(n=1) +--- +test27: --- +assert(extension.times(extension) == Failure) + | | | | + | | | false + | | Extension(n=1) + | Extension(n=1) + Extension(n=1) +--- +test28: --- +assert(dispatch.contains(dispatch)) + | | | + | | Dispatch(n=1) + | false + Dispatch(n=1) +--- +test29: --- +assert(extension.contains(dispatch)) + | | | + | | Dispatch(n=1) + | false + Extension(n=1) +--- +test30: --- +assert(extension.contains(extension)) + | | | + | | Extension(n=1) + | false + Extension(n=1) +--- +test31: --- +assert(dispatch.contains(context)) + | | | + | | Context(n=1) + | false + Dispatch(n=1) +--- +test32: --- +assert(dispatch.contains(context)) + | | | + | | Context(n=1) + | false + Dispatch(n=1) +--- +test33: --- +assert(extension.contains(dispatch)) + | | | + | | Dispatch(n=1) + | false + Extension(n=1) +--- +test34: --- +assert(extension.contains(dispatch)) + | | | + | | Dispatch(n=1) + | false + Extension(n=1) +--- +test35: --- +assert(extension.contains(context)) + | | | + | | Context(n=1) + | false + Extension(n=1) +--- +test36: --- +assert(extension.contains(context)) + | | | + | | Context(n=1) + | false + Extension(n=1) +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/operator/invokeOpeartor.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/invokeOpeartor.noruntime.box.txt new file mode 100644 index 0000000..644a6af --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/operator/invokeOpeartor.noruntime.box.txt
@@ -0,0 +1,45 @@ +test1: --- +assert(stringValue()) + | | + | false + true +--- +test2: --- +assert(Callable()() == "World") + | | | + | | false + | Hello + Callable +--- +test3: --- +assert(Callable()(listOf(1,2,3)) == "World") + | || | + | || false + | |[1, 2, 3] + | Hello + Callable +--- +test4: --- +assert(Callable()(1, listOf(1,2,3)) == "World") + | | | | + | | | false + | | [1, 2, 3] + | Hello + Callable +--- +test5: --- +assert(listOf(NamedLambda("Hello") { "Hello" }, NamedLambda("World") { "World" })[1]() == "Hello") + | | | | | | + | | | | | false + | | | | World + | | | Lambda: World + | | Lambda: World + | Lambda: Hello + [Lambda: Hello, Lambda: World] +--- +test6: --- +assert((::foo)(4)) + | | + | false + fun foo(kotlin.Int): kotlin.Boolean +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/ContextReceivers.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/ContextReceivers.noruntime.box.txt new file mode 100644 index 0000000..73969a9 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/ContextReceivers.noruntime.box.txt
@@ -0,0 +1,24 @@ +test1: --- +context1Assert("test".length == 5) + | | + | false + 4 +--- +test2: --- +context1Assert("test".length == 5) + | | + | false + 4 +--- +test3: --- +context2Assert("test".length == 5) + | | + | false + 4 +--- +test4: --- +context2Assert("test".length == 5) + | | + | false + 4 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/ContextReceivers.noruntime.kt.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/ContextReceivers.noruntime.kt.txt new file mode 100644 index 0000000..dd823d3 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/ContextReceivers.noruntime.kt.txt
@@ -0,0 +1,129 @@ +data object Asserter { + private constructor() /* primary */ { + super/*Any*/() + /* <init>() */ + + } + + override operator fun equals(other: Any?): Boolean { + when { + EQEQEQ(arg0 = <this>, arg1 = other) -> return true + } + when { + other !is Asserter -> return false + } + val tmp_0: Asserter = other /*as Asserter */ + return true + } + + override fun hashCode(): Int { + return -308598125 + } + + override fun toString(): String { + return "Asserter" + } + +} + +fun box(): String { + return runAll(tests = [to<String, Function0<Unit>>(/* <this> = "test1", */ that = local fun <anonymous>() { + test1() + } +), to<String, Function0<Unit>>(/* <this> = "test2", */ that = local fun <anonymous>() { + test2() + } +), to<String, Function0<Unit>>(/* <this> = "test3", */ that = local fun <anonymous>() { + test3() + } +), to<String, Function0<Unit>>(/* <this> = "test4", */ that = local fun <anonymous>() { + test4() + } +)]) +} + +context($context-Asserter: Asserter) +fun context1Assert(condition: Boolean, msg: Any? = null) { + when { + condition.not() -> throw AssertionError(p0 = toString(/* <this> = msg */)) + } +} + +context($context-Asserter$1: Asserter, $context-Asserter$2: Asserter) +fun context2Assert(condition: Boolean, msg: Any? = null) { + when { + condition.not() -> throw AssertionError(p0 = toString(/* <this> = msg */)) + } +} + +fun test1() { + with<Asserter, Unit>(receiver = Asserter, block = local fun Asserter.<anonymous>() { + { // BLOCK + val tmp0_Explain: Asserter = $this$with + { // BLOCK + val tmp1_Explain: String = "test" + val tmp2_Explain: Int = tmp1_Explain.<get-length>() + val tmp3_Explain: Int = 5 + val tmp4_Explain: Boolean = EQEQ(arg0 = tmp2_Explain, arg1 = tmp3_Explain) + context1Assert(/* $context-Asserter = tmp0_Explain, */ condition = tmp4_Explain, msg = "\ncontext1Assert(\"test\".length == 5)" + "\n | |" + "\n | " + tmp4_Explain + "\n " + tmp2_Explain + "\n") + } + } + } +) +} + +fun test2() { + context<Asserter, Unit>(with = Asserter, block = context($context-Asserter: Asserter) + local fun <anonymous>() { + { // BLOCK + val tmp0_Explain: Asserter = $context-Asserter + { // BLOCK + val tmp1_Explain: String = "test" + val tmp2_Explain: Int = tmp1_Explain.<get-length>() + val tmp3_Explain: Int = 5 + val tmp4_Explain: Boolean = EQEQ(arg0 = tmp2_Explain, arg1 = tmp3_Explain) + context1Assert(/* $context-Asserter = tmp0_Explain, */ condition = tmp4_Explain, msg = "\ncontext1Assert(\"test\".length == 5)" + "\n | |" + "\n | " + tmp4_Explain + "\n " + tmp2_Explain + "\n") + } + } + } +) +} + +fun test3() { + with<Asserter, Unit>(receiver = Asserter, block = local fun Asserter.<anonymous>() { + { // BLOCK + val tmp0_Explain: Asserter = $this$with + { // BLOCK + val tmp1_Explain: Asserter = $this$with + { // BLOCK + val tmp2_Explain: String = "test" + val tmp3_Explain: Int = tmp2_Explain.<get-length>() + val tmp4_Explain: Int = 5 + val tmp5_Explain: Boolean = EQEQ(arg0 = tmp3_Explain, arg1 = tmp4_Explain) + context2Assert(/* $context-Asserter$1 = tmp0_Explain, $context-Asserter$2 = tmp1_Explain, */ condition = tmp5_Explain, msg = "\ncontext2Assert(\"test\".length == 5)" + "\n | |" + "\n | " + tmp5_Explain + "\n " + tmp3_Explain + "\n") + } + } + } + } +) +} + +fun test4() { + context<Asserter, Unit>(with = Asserter, block = context($context-Asserter: Asserter) + local fun <anonymous>() { + { // BLOCK + val tmp0_Explain: Asserter = $context-Asserter + { // BLOCK + val tmp1_Explain: Asserter = $context-Asserter + { // BLOCK + val tmp2_Explain: String = "test" + val tmp3_Explain: Int = tmp2_Explain.<get-length>() + val tmp4_Explain: Int = 5 + val tmp5_Explain: Boolean = EQEQ(arg0 = tmp3_Explain, arg1 = tmp4_Explain) + context2Assert(/* $context-Asserter$1 = tmp0_Explain, $context-Asserter$2 = tmp1_Explain, */ condition = tmp5_Explain, msg = "\ncontext2Assert(\"test\".length == 5)" + "\n | |" + "\n | " + tmp5_Explain + "\n " + tmp3_Explain + "\n") + } + } + } + } +) +}
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/DefaultArgumentWithOverload.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/DefaultArgumentWithOverload.noruntime.box.txt new file mode 100644 index 0000000..adff54f --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/DefaultArgumentWithOverload.noruntime.box.txt
@@ -0,0 +1,18 @@ +test1: --- +powerAssert("test".length == 5) + | | + | false + 4 +--- +test2: ---bad +powerAssert("test".length == 5, msg = "bad") + | | + | false + 4 +--- +test3: ---bad +powerAssert("test".length == 5, msg = { "bad" }) + | | + | false + 4 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/DefaultArgumentWithOverload.noruntime.kt.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/DefaultArgumentWithOverload.noruntime.kt.txt new file mode 100644 index 0000000..0921dc9 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/DefaultArgumentWithOverload.noruntime.kt.txt
@@ -0,0 +1,75 @@ +fun box(): String { + return runAll(tests = [to<String, Function0<Unit>>(/* <this> = "test1", */ that = local fun <anonymous>() { + test1() + } +), to<String, Function0<Unit>>(/* <this> = "test2", */ that = local fun <anonymous>() { + test2() + } +), to<String, Function0<Unit>>(/* <this> = "test3", */ that = local fun <anonymous>() { + test3() + } +)]) +} + +fun powerAssert(condition: Boolean, msg: Function0<String>) { + when { + condition.not() -> throw AssertionError(p0 = msg.invoke()) + } +} + +fun powerAssert(condition: Boolean, msg: String? = null) { + when { + condition.not() -> throw AssertionError(p0 = { // BLOCK + val tmp_0: String? = { // BLOCK + val tmp_1: String? = msg + when { + EQEQ(arg0 = tmp_1, arg1 = null) -> null + else -> tmp_1 /*as String */.toString() + } + } + when { + EQEQ(arg0 = tmp_0, arg1 = null) -> "Assertion failed" + else -> tmp_0 + } + }) + } +} + +fun test1() { + { // BLOCK + val tmp0_Explain: String = "test" + val tmp1_Explain: Int = tmp0_Explain.<get-length>() + val tmp2_Explain: Int = 5 + val tmp3_Explain: Boolean = EQEQ(arg0 = tmp1_Explain, arg1 = tmp2_Explain) + powerAssert(condition = tmp3_Explain, msg = local fun <anonymous>(): String { + return "\npowerAssert(\"test\".length == 5)" + "\n | |" + "\n | " + tmp3_Explain + "\n " + tmp1_Explain + "\n" + } +) + } +} + +fun test2() { + { // BLOCK + val tmp0_Explain: String = "test" + val tmp1_Explain: Int = tmp0_Explain.<get-length>() + val tmp2_Explain: Int = 5 + val tmp3_Explain: Boolean = EQEQ(arg0 = tmp1_Explain, arg1 = tmp2_Explain) + powerAssert(condition = tmp3_Explain, msg = "bad" + "\npowerAssert(\"test\".length == 5, msg = \"bad\")" + "\n | |" + "\n | " + tmp3_Explain + "\n " + tmp1_Explain + "\n") + } +} + +fun test3() { + { // BLOCK + val tmp0_Explain: String = "test" + val tmp1_Explain: Int = tmp0_Explain.<get-length>() + val tmp2_Explain: Int = 5 + val tmp3_Explain: Boolean = EQEQ(arg0 = tmp1_Explain, arg1 = tmp2_Explain) + powerAssert(condition = tmp3_Explain, msg = local fun <anonymous>(): String { + return local fun <anonymous>(): String { + return "bad" + } +.invoke() + "\npowerAssert(\"test\".length == 5, msg = { \"bad\" })" + "\n | |" + "\n | " + tmp3_Explain + "\n " + tmp1_Explain + "\n" + } +) + } +}
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/Receivers.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/Receivers.noruntime.box.txt new file mode 100644 index 0000000..af02995 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/Receivers.noruntime.box.txt
@@ -0,0 +1,36 @@ +test1: --- +Asserter.dispatchAssert("test".length == 5) + | | + | false + 4 +--- +test2: --- +dispatchAssert("test".length == 5) + | | + | false + 4 +--- +test3: --- +Asserter.extensionAssert("test".length == 5) + | | + | false + 4 +--- +test4: --- +extensionAssert("test".length == 5) + | | + | false + 4 +--- +test5: --- +Asserter.memberExtensionAssert("test".length == 5) + | | + | false + 4 +--- +test6: --- +memberExtensionAssert("test".length == 5) + | | + | false + 4 +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/Receivers.noruntime.kt.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/Receivers.noruntime.kt.txt new file mode 100644 index 0000000..a475389 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/Receivers.noruntime.kt.txt
@@ -0,0 +1,163 @@ +data object Asserter { + private constructor() /* primary */ { + super/*Any*/() + /* <init>() */ + + } + + override operator fun equals(other: Any?): Boolean { + when { + EQEQEQ(arg0 = <this>, arg1 = other) -> return true + } + when { + other !is Asserter -> return false + } + val tmp_0: Asserter = other /*as Asserter */ + return true + } + + override fun hashCode(): Int { + return -308598125 + } + + override fun toString(): String { + return "Asserter" + } + + fun dispatchAssert(condition: Boolean, msg: Any? = null) { + when { + condition.not() -> throw AssertionError(p0 = toString(/* <this> = msg */)) + } + } + + fun Asserter.memberExtensionAssert(condition: Boolean, msg: Any? = null) { + when { + condition.not() -> throw AssertionError(p0 = toString(/* <this> = msg */)) + } + } + +} + +fun box(): String { + return runAll(tests = [to<String, Function0<Unit>>(/* <this> = "test1", */ that = local fun <anonymous>() { + test1() + } +), to<String, Function0<Unit>>(/* <this> = "test2", */ that = local fun <anonymous>() { + test2() + } +), to<String, Function0<Unit>>(/* <this> = "test3", */ that = local fun <anonymous>() { + test3() + } +), to<String, Function0<Unit>>(/* <this> = "test4", */ that = local fun <anonymous>() { + test4() + } +), to<String, Function0<Unit>>(/* <this> = "test5", */ that = local fun <anonymous>() { + test5() + } +), to<String, Function0<Unit>>(/* <this> = "test6", */ that = local fun <anonymous>() { + test6() + } +)]) +} + +fun Asserter.extensionAssert(condition: Boolean, msg: Any? = null) { + when { + condition.not() -> throw AssertionError(p0 = toString(/* <this> = msg */)) + } +} + +fun test1() { + { // BLOCK + val tmp0_Explain: Asserter = Asserter + { // BLOCK + val tmp1_Explain: String = "test" + val tmp2_Explain: Int = tmp1_Explain.<get-length>() + val tmp3_Explain: Int = 5 + val tmp4_Explain: Boolean = EQEQ(arg0 = tmp2_Explain, arg1 = tmp3_Explain) + tmp0_Explain.dispatchAssert(condition = tmp4_Explain, msg = "\nAsserter.dispatchAssert(\"test\".length == 5)" + "\n | |" + "\n | " + tmp4_Explain + "\n " + tmp2_Explain + "\n") + } + } +} + +fun test2() { + with<Asserter, Unit>(receiver = Asserter, block = local fun Asserter.<anonymous>() { + { // BLOCK + val tmp0_Explain: Asserter = $this$with + { // BLOCK + val tmp1_Explain: String = "test" + val tmp2_Explain: Int = tmp1_Explain.<get-length>() + val tmp3_Explain: Int = 5 + val tmp4_Explain: Boolean = EQEQ(arg0 = tmp2_Explain, arg1 = tmp3_Explain) + tmp0_Explain.dispatchAssert(condition = tmp4_Explain, msg = "\ndispatchAssert(\"test\".length == 5)" + "\n | |" + "\n | " + tmp4_Explain + "\n " + tmp2_Explain + "\n") + } + } + } +) +} + +fun test3() { + { // BLOCK + val tmp0_Explain: Asserter = Asserter + { // BLOCK + val tmp1_Explain: String = "test" + val tmp2_Explain: Int = tmp1_Explain.<get-length>() + val tmp3_Explain: Int = 5 + val tmp4_Explain: Boolean = EQEQ(arg0 = tmp2_Explain, arg1 = tmp3_Explain) + extensionAssert(/* <this> = tmp0_Explain, */ condition = tmp4_Explain, msg = "\nAsserter.extensionAssert(\"test\".length == 5)" + "\n | |" + "\n | " + tmp4_Explain + "\n " + tmp2_Explain + "\n") + } + } +} + +fun test4() { + with<Asserter, Unit>(receiver = Asserter, block = local fun Asserter.<anonymous>() { + { // BLOCK + val tmp0_Explain: Asserter = $this$with + { // BLOCK + val tmp1_Explain: String = "test" + val tmp2_Explain: Int = tmp1_Explain.<get-length>() + val tmp3_Explain: Int = 5 + val tmp4_Explain: Boolean = EQEQ(arg0 = tmp2_Explain, arg1 = tmp3_Explain) + extensionAssert(/* <this> = tmp0_Explain, */ condition = tmp4_Explain, msg = "\nextensionAssert(\"test\".length == 5)" + "\n | |" + "\n | " + tmp4_Explain + "\n " + tmp2_Explain + "\n") + } + } + } +) +} + +fun test5() { + with<Asserter, Unit>(receiver = Asserter, block = local fun Asserter.<anonymous>() { + { // BLOCK + val tmp0_Explain: Asserter = $this$with + { // BLOCK + val tmp1_Explain: Asserter = Asserter + { // BLOCK + val tmp2_Explain: String = "test" + val tmp3_Explain: Int = tmp2_Explain.<get-length>() + val tmp4_Explain: Int = 5 + val tmp5_Explain: Boolean = EQEQ(arg0 = tmp3_Explain, arg1 = tmp4_Explain) + tmp0_Explain.memberExtensionAssert(/* <this> = tmp1_Explain, */ condition = tmp5_Explain, msg = "\nAsserter.memberExtensionAssert(\"test\".length == 5)" + "\n | |" + "\n | " + tmp5_Explain + "\n " + tmp3_Explain + "\n") + } + } + } + } +) +} + +fun test6() { + with<Asserter, Unit>(receiver = Asserter, block = local fun Asserter.<anonymous>() { + { // BLOCK + val tmp0_Explain: Asserter = $this$with + { // BLOCK + val tmp1_Explain: Asserter = $this$with + { // BLOCK + val tmp2_Explain: String = "test" + val tmp3_Explain: Int = tmp2_Explain.<get-length>() + val tmp4_Explain: Int = 5 + val tmp5_Explain: Boolean = EQEQ(arg0 = tmp3_Explain, arg1 = tmp4_Explain) + tmp0_Explain.memberExtensionAssert(/* <this> = tmp1_Explain, */ condition = tmp5_Explain, msg = "\nmemberExtensionAssert(\"test\".length == 5)" + "\n | |" + "\n | " + tmp5_Explain + "\n " + tmp3_Explain + "\n") + } + } + } + } +) +}
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/TypeParameters.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/TypeParameters.noruntime.box.txt new file mode 100644 index 0000000..8bedf62 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/TypeParameters.noruntime.box.txt
@@ -0,0 +1,15 @@ +--- +requireNotNull(a as? String) + | | + | null + 1 +--- +--- +checkNotNull(a as? String) + | | + | null + 1 +--- +---OK--- +---OK--- +---OK---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/VarargParameter.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/VarargParameter.noruntime.box.txt new file mode 100644 index 0000000..e4902a9 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/VarargParameter.noruntime.box.txt
@@ -0,0 +1,10 @@ +--- +assert(listOf("a", "b", "c") == listOf(i++, i++, i++)) + | | | | | | + | | | | | 2 + | | | | 1 + | | | 0 + | | [0, 1, 2] + | false + [a, b, c] +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/implicitReceiver.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/implicitReceiver.noruntime.box.txt new file mode 100644 index 0000000..3e9db1e --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/parameters/implicitReceiver.noruntime.box.txt
@@ -0,0 +1,130 @@ +test1: --- +assert(length == 5) + | | + | false + 4 +--- +test2: --- +assert(this.length == 5) + | | | + | | false + | 4 + test +--- +test3: --- +assert(substring(1, 3) == "TEST") + | | + | false + es +--- +test4: --- +assert(this.substring(1, 3) == "TEST") + | | | + | | false + | es + test +--- +test5: --- +assert(length == 5) + | | + | false + 4 +--- +test6: --- +assert(this.length == 5) + | | | + | | false + | 4 + test +--- +test7: --- +assert(substring(1, 3) == "TEST") + | | + | false + es +--- +test8: --- +assert(this.substring(1, 3) == "TEST") + | | | + | | false + | es + test +--- +Test.test9(): --- +assert(length == 5) + | | + | false + 4 +--- +Test.test10(): --- +assert(this.length == 5) + | | | + | | false + | 4 + test +--- +Test.test11(): --- +assert(substring(1, 3) == "TEST") + | | + | false + es +--- +Test.test12(): --- +assert(this.substring(1, 3) == "TEST") + | | | + | | false + | es + test +--- +Test.test13(): --- +assert(mutate() == "TEST") + | | + | false + tset +--- +Test.test14(): --- +assert(this.mutate() == "TEST") + | | | + | | false + | tset + test +--- +Test.test15(): --- +assert(length == 5) + | | + | false + 4 +--- +Test.test16(): --- +assert(this.length == 5) + | | | + | | false + | 4 + test +--- +Test.test17(): --- +assert(substring(1, 3) == "TEST") + | | + | false + es +--- +Test.test18(): --- +assert(this.substring(1, 3) == "TEST") + | | | + | | false + | es + test +--- +Test.test19(): --- +assert(mutate() == "TEST") + | | + | false + tset +--- +Test.test20(): --- +assert(this.mutate() == "TEST") + | | | + | | false + | tset + test +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/property/booleanProperty.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/property/booleanProperty.noruntime.box.txt new file mode 100644 index 0000000..43243e8 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/property/booleanProperty.noruntime.box.txt
@@ -0,0 +1,46 @@ +test1: --- +assert(booleanValue) + | + false +--- +test2: --- +assert(memberProperty) + | + false +--- +test3: --- +assert(delegatedProperty) + | + false +--- +test4: --- +assert(1.extensionTopLevelProperty) + | + false +--- +test5: --- +assert(true.extensionTopLevelPropertyWithTypeParam) + | + false +--- +test6: --- +assert(with(false) { contextProperty }) + | + false +--- +test7: --- +assert(true.contextPropertyWithTypeParam) + | + false +--- +test8: --- +assert(lateInitProperty == "b") + | | + | false + a +--- +test9: --- +assert(destructuring) + | + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/property/enumWithBooleanProperty.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/property/enumWithBooleanProperty.noruntime.box.txt new file mode 100644 index 0000000..61759b7 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/property/enumWithBooleanProperty.noruntime.box.txt
@@ -0,0 +1,5 @@ +--- +assert(Status.INACTIVE.isActive) + | + false +---
diff --git a/plugins/power-assert/power-assert-compiler/testData/codegen/property/propertyInCompanion.noruntime.box.txt b/plugins/power-assert/power-assert-compiler/testData/codegen/property/propertyInCompanion.noruntime.box.txt new file mode 100644 index 0000000..e48f157 --- /dev/null +++ b/plugins/power-assert/power-assert-compiler/testData/codegen/property/propertyInCompanion.noruntime.box.txt
@@ -0,0 +1,5 @@ +--- +assert(B.b) + | + false +---