aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-05-12 15:05:26 +0000
committers-ol <s+removethis@s-ol.nu>2025-03-02 14:23:21 +0000
commit07e5044618d0715d04f02384c960e3ad86903561 (patch)
tree92b64305a4109731beb26109278a0b9ee1827587 /spec
parentreport errors when requiring lua modules (diff)
downloadalive-07e5044618d0715d04f02384c960e3ad86903561.tar.gz
alive-07e5044618d0715d04f02384c960e3ad86903561.zip
EvtStream:set(nil) doesnt set :dirty
Diffstat (limited to 'spec')
-rw-r--r--spec/result/evt_spec.moon17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/result/evt_spec.moon b/spec/result/evt_spec.moon
index 93c09e0..c9416db 100644
--- a/spec/result/evt_spec.moon
+++ b/spec/result/evt_spec.moon
@@ -52,6 +52,23 @@ describe 'EvtStream', ->
assert.is.equal 3, stream\unwrap!
assert.is.true stream\dirty!
+ it 'ignores nil values', ->
+ stream = EvtStream T.num
+ assert.is.nil stream\unwrap!
+ assert.is.false stream\dirty!
+
+ stream\set!
+ assert.is.nil stream\unwrap!
+ assert.is.false stream\dirty!
+
+ stream\set nil
+ assert.is.nil stream\unwrap!
+ assert.is.false stream\dirty!
+
+ stream\set false
+ assert.is.equal false, stream\unwrap!
+ assert.is.true stream\dirty!
+
it 'errors when set twice', ->
stream = EvtStream T.num
stream\set 1