From 00e5e070d71cf6233811bdccbf96f2b16fc2027b Mon Sep 17 00:00:00 2001 From: Ilya Matveev Date: Mon, 27 Feb 2017 16:27:45 +0300 Subject: [PATCH] tests: Add a test for list sorting --- backend.native/tests/build.gradle | 5 +++++ backend.native/tests/runtime/collections/sort1.kt | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 backend.native/tests/runtime/collections/sort1.kt diff --git a/backend.native/tests/build.gradle b/backend.native/tests/build.gradle index 3d0ced6ecb2..27e4e7d604b 100644 --- a/backend.native/tests/build.gradle +++ b/backend.native/tests/build.gradle @@ -613,6 +613,11 @@ task sort0(type: RunKonanTest) { source = "runtime/collections/sort0.kt" } +task sort1(type: RunKonanTest) { + goldValue = "[a, b, x]\n[-1, 0, 42, 239, 100500]\n" + source = "runtime/collections/sort1.kt" +} + task if_else(type: RunKonanTest) { source = "codegen/branching/if_else.kt" } diff --git a/backend.native/tests/runtime/collections/sort1.kt b/backend.native/tests/runtime/collections/sort1.kt new file mode 100644 index 00000000000..0670906516e --- /dev/null +++ b/backend.native/tests/runtime/collections/sort1.kt @@ -0,0 +1,9 @@ +fun main(a: Array) { + val foo = mutableListOf("x", "a", "b") + foo.sort() + println(foo.toString()) + + var bar = mutableListOf(239, 42, -1, 100500, 0) + bar.sort() + println(bar.toString()) +} \ No newline at end of file