From cb632562e312e17c1cbdfba3cc6fd625a1da38b1 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Mon, 24 Apr 2023 18:14:40 -0400 Subject: Scope claims in docs/examples/tests --- test/commit.tcl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'test/commit.tcl') diff --git a/test/commit.tcl b/test/commit.tcl index c1328c12..b54d202b 100644 --- a/test/commit.tcl +++ b/test/commit.tcl @@ -6,12 +6,12 @@ proc assert condition { } Assert programBall has program code { - Commit { Claim there is a ball at x 100 y 100 } + Commit { Claim $this has a ball at x 100 y 100 } - When there is a ball at x /x/ y /y/ { + When $this has a ball at x /x/ y /y/ { puts "ball at $x $y" After 10 milliseconds { - Commit { Claim there is a ball at x $x y [expr {$y+1}] } + Commit { Claim $this has a ball at x $x y [expr {$y+1}] } if {$y > 115} { set ::done true } } } @@ -22,20 +22,20 @@ vwait ::done Retract programBall has program code /something/ Assert programUpdate has program code { - Commit { Claim there have been 0 boops } + Commit { Claim $this has seen 0 boops } - Every time there is a boop & there have been /n/ boops { - Commit { Claim there have been [expr {$n + 1}] boops } + Every time there is a boop & $this has seen /n/ boops { + Commit { Claim $this has seen [expr {$n + 1}] boops } } } Assert there is a boop Step -assert {[dict get [lindex [Statements::findMatches [list /someone/ claims there have been /n/ boops]] 0] n] eq 1} +assert {[dict get [lindex [Statements::findMatches [list /someone/ claims /thing/ has seen /n/ boops]] 0] n] eq 1} Retract there is a boop Assert there is a boop Step -assert {[dict get [lindex [Statements::findMatches [list /someone/ claims there have been /n/ boops]] 0] n] eq 2} +assert {[dict get [lindex [Statements::findMatches [list /someone/ claims /thing/ has seen /n/ boops]] 0] n] eq 2} -- cgit v1.2.3