aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/target/ruby.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/lux/target/ruby.lux')
-rw-r--r--stdlib/source/test/lux/target/ruby.lux21
1 files changed, 20 insertions, 1 deletions
diff --git a/stdlib/source/test/lux/target/ruby.lux b/stdlib/source/test/lux/target/ruby.lux
index 281ffe594..ee6b63d1c 100644
--- a/stdlib/source/test/lux/target/ruby.lux
+++ b/stdlib/source/test/lux/target/ruby.lux
@@ -432,7 +432,8 @@
Test
(do [! random.monad]
[float/0 random.safe_frac
- $global (# ! each /.global (random.ascii/lower 10))]
+ $global (# ! each /.global (random.ascii/lower 10))
+ pattern (# ! each /.string (random.ascii/lower 11))]
($_ _.and
(_.cover [/.global]
(expression (|>> (:as Text) (text#= "global-variable"))
@@ -461,6 +462,24 @@
(_.cover [/.command_line_arguments]
(expression (|>> (:as Int) (i.= +0))
(/.the "length" /.command_line_arguments)))
+ (_.cover [/.last_string_matched]
+ (expression (|>> (:as Bit))
+ (|> ($_ /.then
+ (/.statement
+ (|> (/.manual "Regexp")
+ (/.new (list pattern) {.#None})
+ (/.do "match" (list pattern) {.#None})))
+ (/.return (/.= pattern /.last_string_matched)))
+ [(list)] (/.lambda {.#None})
+ (/.apply_lambda/* (list)))))
+ (_.cover [/.last_regexp_match]
+ (expression (|>> (:as Bit))
+ (|> (/.return (|> (/.manual "Regexp")
+ (/.new (list pattern) {.#None})
+ (/.do "match" (list pattern) {.#None})
+ (/.= /.last_regexp_match)))
+ [(list)] (/.lambda {.#None})
+ (/.apply_lambda/* (list)))))
)))
(def: test|local_var