about summary refs log tree commit diff stats
path: root/mu.arc.t
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-02-07 21:31:35 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-02-07 21:31:35 -0800
commit50ec8698320239deb0a5a24f9efc2bcdae425a58 (patch)
tree77cd798b295080418f5a36556c60c5c2770a6f4e /mu.arc.t
parent7962e0fd085e408e24201ca3951c48e17aec7411 (diff)
downloadmu-50ec8698320239deb0a5a24f9efc2bcdae425a58.tar.gz
712
Diffstat (limited to 'mu.arc.t')
-rw-r--r--mu.arc.t14
1 files changed, 14 insertions, 0 deletions
diff --git a/mu.arc.t b/mu.arc.t
index df439e13..622ea7a9 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -4357,6 +4357,20 @@
 ;? (quit) ;? 1
 
 (reset)
+(new-trace "string-split-first")
+(add-code
+  '((function main [
+      (1:string-address <- new "a/b")
+      (2:string-address 3:string-address <- split-first 1:string-address ((#\/ literal)))
+     ])))
+(run 'main)
+(each routine completed-routines*
+  (aif rep.routine!error (prn "error - " it)))
+(when (or (~memory-contains-array memory*.2 "a")
+          (~memory-contains-array memory*.3 "b"))
+  (prn "F - 'split-first' cuts string at first occurrence of delimiter"))
+
+(reset)
 (new-trace "integer-to-decimal-string")
 (add-code
   '((function main [