Add mksort implementation

Bug: 218736658
Test: ./out/rbcrun ./build/make/tests/run.rbc
Change-Id: I0069e7059453c16d299cc650f56c320d905f1958
This commit is contained in:
Cole Faust
2022-04-05 16:34:23 -07:00
parent 52233be25c
commit 2491ad52c1
2 changed files with 18 additions and 0 deletions

View File

@@ -32,6 +32,9 @@ def assert_eq(expected, actual):
fail("Expected '%s', got '%s'" % (expected, actual))
# Unit tests for non-trivial runtime functions
assert_eq(["a", "b", "c"], rblf.mksort("b a c c"))
assert_eq(["a", "b", "c"], rblf.mksort(["b", "a", "c", "c"]))
assert_eq("", rblf.mkstrip(" \n \t "))
assert_eq("a b c", rblf.mkstrip(" a b \n c \t"))
assert_eq(1, rblf.mkstrip(1))