From f6a84c325f0be85a69424b9f8659bffedde7adc3 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Sat, 12 Aug 2023 17:30:44 -0400 Subject: 0:0 bug test that actually is repeatable --- test/stale.tcl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/stale.tcl (limited to 'test') diff --git a/test/stale.tcl b/test/stale.tcl new file mode 100644 index 00000000..32ca6860 --- /dev/null +++ b/test/stale.tcl @@ -0,0 +1,14 @@ +Assert when we are running {{} { + When the iteration count is /k/ { + Commit { Claim the counted iteration count is $k } + } +}} +Assert we are running +Step + +for {set i 0} {$i < 10000} {incr i} { + Commit [list Claim the iteration count is $i] + Step +} + +exec dot -Tpdf >stale.pdf <<[Statements::dot] -- cgit v1.2.3 From 3047b5b0675db8c1119750341b81e7519e5f8808 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Sat, 12 Aug 2023 17:31:32 -0400 Subject: test/stale: Simplify --- test/stale.tcl | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'test') diff --git a/test/stale.tcl b/test/stale.tcl index 32ca6860..189d6d9d 100644 --- a/test/stale.tcl +++ b/test/stale.tcl @@ -1,12 +1,4 @@ -Assert when we are running {{} { - When the iteration count is /k/ { - Commit { Claim the counted iteration count is $k } - } -}} -Assert we are running -Step - -for {set i 0} {$i < 10000} {incr i} { +for {set i 0} {$i < 30000} {incr i} { Commit [list Claim the iteration count is $i] Step } -- cgit v1.2.3 From 6e5d650a7a11a6fa34661e578be64298ecd601a8 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Sat, 12 Aug 2023 17:35:40 -0400 Subject: test/stale: Use assert --- test/stale.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test') diff --git a/test/stale.tcl b/test/stale.tcl index 189d6d9d..7b2fcd70 100644 --- a/test/stale.tcl +++ b/test/stale.tcl @@ -3,4 +3,4 @@ for {set i 0} {$i < 30000} {incr i} { Step } -exec dot -Tpdf >stale.pdf <<[Statements::dot] +assert {[llength [Statements::findMatches [list /someone/ claims the iteration count is /i/]]] == 1} -- cgit v1.2.3 From 5f08c1da793d98ce1269d7a9a47ec191024f9356 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Mon, 14 Aug 2023 20:48:50 -0400 Subject: Evaluator: better incrementalize collect --- test/survival.tcl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/survival.tcl (limited to 'test') diff --git a/test/survival.tcl b/test/survival.tcl new file mode 100644 index 00000000..821b865a --- /dev/null +++ b/test/survival.tcl @@ -0,0 +1,23 @@ +Assert when we are running {{} { + When the collected matches for [list tag /k/ is visible] are /matches/ { + foreach m $matches { + Claim a tag is visible + } + puts "Collecting: [llength $matches] matches" + } + When a tag is visible { + On unmatch { + puts "Unmatching. Should not unmatch" + } + } +}} +Assert we are running +Step + +Assert tag 1 is visible +Step + +Assert tag 2 is visible +Assert tag 3 is visible +Retract tag 1 is visible +Step -- cgit v1.2.3 From cf16ae229066352c3194e8b225bdf9b996a40738 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Mon, 14 Aug 2023 22:56:16 -0400 Subject: Try to fix collect incremental --- test/survival.tcl | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'test') diff --git a/test/survival.tcl b/test/survival.tcl index 821b865a..914ab45d 100644 --- a/test/survival.tcl +++ b/test/survival.tcl @@ -1,23 +1,25 @@ Assert when we are running {{} { - When the collected matches for [list tag /k/ is visible] are /matches/ { + When the collected matches for [list tag /k/ was seen by /x/ at /p/] are /matches/ { + set tagsSeen [dict create] foreach m $matches { - Claim a tag is visible + dict set tagsSeen [dict get $m k] true } - puts "Collecting: [llength $matches] matches" + dict for {k _} $tagsSeen { Claim tag $k is a tag } } - When a tag is visible { - On unmatch { - puts "Unmatching. Should not unmatch" - } + When tag /k/ is a tag { + puts "Saw tag $k" + On unmatch { error "Should never unmatch" } } }} Assert we are running Step -Assert tag 1 is visible +Commit Omar { Claim tag 1 was seen by Omar at home } +Commit Mom { Claim tag 1 was seen by Mom at restaurant } Step -Assert tag 2 is visible -Assert tag 3 is visible -Retract tag 1 is visible +Commit Omar { Claim tag 1 was seen by Omar at work } Step + +# Statements::print + -- cgit v1.2.3