summaryrefslogtreecommitdiff
path: root/lib/std/test/slcp.myr
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/test/slcp.myr')
-rw-r--r--lib/std/test/slcp.myr14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/std/test/slcp.myr b/lib/std/test/slcp.myr
new file mode 100644
index 0000000..67c8298
--- /dev/null
+++ b/lib/std/test/slcp.myr
@@ -0,0 +1,14 @@
+use std
+
+const main = {
+ var a = [1,2,3,4,5]
+ var b = [6,7,8,9,10]
+ var a_cped = [3, 4, 5, 4, 5]
+ var b_cped = [6, 7, 6, 7, 8]
+
+
+ std.slcp(a[:a.len-2], a[2:])
+ std.slcp(b[2:], b[:b.len-2])
+ std.assert(std.sleq(a[:], a_cped[:]), "slcp of a failed")
+ std.assert(std.sleq(b[:], b_cped[:]), "slcp of a failed")
+}