summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2023-05-07 21:11:46 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2023-05-07 21:11:46 +0200
commit2d5508898e90c01680cab60295b9c1e8164d65da (patch)
treeebc3c05b3b2bdb4586aeb66b7936faaf3820cb8e
parent3fc29ed18ea46e83e2ba2d4b39e52239771f427c (diff)
Test: use parentheses for guard expressions
-rw-r--r--test/attach.test2
-rw-r--r--test/contact.test41
-rw-r--r--test/storage.test16
-rw-r--r--test/sync.test2
4 files changed, 32 insertions, 29 deletions
diff --git a/test/attach.test b/test/attach.test
index 1e2f5e8..33a1483 100644
--- a/test/attach.test
+++ b/test/attach.test
@@ -33,7 +33,7 @@ test:
send "attach-to 1" to p2
expect /attach-request 1 ([0-9]*)/ from p1 capture code1
expect /attach-response 1 ([0-9]*)/ from p2 capture code2
- guard code1 == code2
+ guard (code1 == code2)
send "attach-accept 1" to p1
send "attach-accept 1" to p2
diff --git a/test/contact.test b/test/contact.test
index 084dd93..438aa1f 100644
--- a/test/contact.test
+++ b/test/contact.test
@@ -64,10 +64,11 @@ test Contact:
# Contact between 1 and 2
- send "contact-request $peer1_2" to p1
- expect /contact-request $peer2_1 ([0-9]*)/ from p2 capture code1_2
- expect /contact-response $peer1_2 ([0-9]*)/ from p1 capture code1_1
- guard code1_1 == code1_2
+ local:
+ send "contact-request $peer1_2" to p1
+ expect /contact-request $peer2_1 ([0-9]*)/ from p2 capture code2
+ expect /contact-response $peer1_2 ([0-9]*)/ from p1 capture code1
+ guard (code1 == code2)
send "contact-accept $peer1_2" to p1
send "contact-accept $peer2_1" to p2
@@ -78,12 +79,12 @@ test Contact:
expect from p1:
/contact-list-item [a-z0-9#]+ Owner2 Owner2/
/contact-list-(.*)/ capture done1_1
- guard done1_1 == "done"
+ guard (done1_1 == "done")
send "contact-list" to p2
expect from p2:
/contact-list-item [a-z0-9#]+ Owner1 Owner1/
/contact-list-(.*)/ capture done1_2
- guard done1_2 == "done"
+ guard (done1_2 == "done")
# Attach peer 4 to Owner1
@@ -91,9 +92,10 @@ test Contact:
expect /local-identity Device4/ from p4
send "attach-to $peer4_1" to p4
- expect /attach-request $peer1_4 ([0-9]*)/ from p1 capture code2_1
- expect /attach-response $peer4_1 ([0-9]*)/ from p4 capture code2_4
- guard code2_1 == code2_4
+ local:
+ expect /attach-request $peer1_4 ([0-9]*)/ from p1 capture code1
+ expect /attach-response $peer4_1 ([0-9]*)/ from p4 capture code4
+ guard (code1 == code4)
send "attach-accept $peer1_4" to p1
send "attach-accept $peer4_1" to p4
@@ -107,9 +109,10 @@ test Contact:
# Contact between 3 and 4
send "contact-request $peer3_4" to p3
- expect /contact-request $peer4_3 ([0-9]*)/ from p4 capture code3_4
- expect /contact-response $peer3_4 ([0-9]*)/ from p3 capture code3_3
- guard code3_3 == code3_4
+ local:
+ expect /contact-request $peer4_3 ([0-9]*)/ from p4 capture code4
+ expect /contact-response $peer3_4 ([0-9]*)/ from p3 capture code3
+ guard (code3 == code4)
send "contact-accept $peer3_4" to p3
send "contact-accept $peer4_3" to p4
@@ -120,7 +123,7 @@ test Contact:
expect from p3:
/contact-list-item [a-z0-9#]+ Owner1 Owner1/
/contact-list-(.*)/ capture done2_3
- guard done2_3 == "done"
+ guard (done2_3 == "done")
send "shared-state-get" to p1
expect /shared-state-get (.*)/ from p1 capture s1
@@ -132,7 +135,7 @@ test Contact:
/contact-list-item ([a-z0-9#]+) Owner2 Owner2/ capture c4_2
/contact-list-item ([a-z0-9#]+) Owner3 Owner3/ capture c4_3
/contact-list-(.*)/ capture done2_4
- guard done2_4 == "done"
+ guard (done2_4 == "done")
# Check sync between 1 and 4
@@ -146,7 +149,7 @@ test Contact:
/contact-list-item ([a-z0-9#]+) Owner2 Owner2/ capture c1_2
/contact-list-item ([a-z0-9#]+) Owner3 Owner3/ capture c1_3
/contact-list-(.*)/ capture done2_1
- guard done2_1 == "done"
+ guard (done2_1 == "done")
# Update custom name
@@ -158,7 +161,7 @@ test Contact:
/contact-list-item $c4_2 Custom2 Owner2/
/contact-list-item $c4_3 Owner3 Owner3/
/contact-list-(.*)/ capture done3_4
- guard done3_4 == "done"
+ guard (done3_4 == "done")
send "shared-state-get" to p4
expect /shared-state-get (.*)/ from p4 capture s4b
@@ -170,7 +173,7 @@ test Contact:
/contact-list-item $c4_2 Custom2 Owner2/
/contact-list-item $c4_3 Owner3 Owner3/
/contact-list-(.*)/ capture done3_1
- guard done3_1 == "done"
+ guard (done3_1 == "done")
send "contact-set-name $c1_2 Custom2B" to p1
expect /contact-set-name-done/ from p1
@@ -182,7 +185,7 @@ test Contact:
/contact-list-item $c1_2 Custom2B Owner2/
/contact-list-item $c1_3 Custom3B Owner3/
/contact-list-(.*)/ capture done4_1
- guard done4_1 == "done"
+ guard (done4_1 == "done")
send "shared-state-get" to p1
expect /shared-state-get (.*)/ from p1 capture s1b
@@ -194,4 +197,4 @@ test Contact:
/contact-list-item $c4_2 Custom2B Owner2/
/contact-list-item $c4_3 Custom3B Owner3/
/contact-list-(.*)/ capture done4_4
- guard done4_4 == "done"
+ guard (done4_4 == "done")
diff --git a/test/storage.test b/test/storage.test
index 6267beb..9bf468e 100644
--- a/test/storage.test
+++ b/test/storage.test
@@ -11,7 +11,7 @@ test Storage:
""
expect from p1:
/store-done (blake2#[0-9a-f]*)/ capture r1
- guard r1 == "blake2#c4a8c69fbc8398acf76a2ec1e5a191f339c4d03c3eb425af19d6d7d5efac6b8e"
+ guard (r1 == "blake2#c4a8c69fbc8398acf76a2ec1e5a191f339c4d03c3eb425af19d6d7d5efac6b8e")
send to p1:
"store rec"
@@ -112,25 +112,25 @@ test Storage:
expect from p1:
/stored-set-item $r1/
/stored-set-(.*)/ capture done1
- guard done1 == "done"
+ guard (done1 == "done")
send to p1 "stored-set-list $s2"
expect from p1:
/stored-set-item $r2/
/stored-set-(.*)/ capture done2
- guard done2 == "done"
+ guard (done2 == "done")
send to p1 "stored-set-list $s3"
expect from p1:
/stored-set-item $r2 $r3/
/stored-set-(.*)/ capture done3
- guard done3 == "done"
+ guard (done3 == "done")
send to p1 "stored-set-list $s4"
expect from p1:
/stored-set-item $r4/
/stored-set-(.*)/ capture done4
- guard done4 == "done"
+ guard (done4 == "done")
send to p1 "stored-set-add $r2_2 $s4"
@@ -143,13 +143,13 @@ test Storage:
/stored-set-item $r4/
/stored-set-item $r2_2/
/stored-set-(.*)/ capture done5
- guard done5 == "done"
+ guard (done5 == "done")
send to p1 "stored-set-list $s6"
expect from p1:
/stored-set-item $r2_3/
/stored-set-(.*)/ capture done6
- guard done6 == "done"
+ guard (done6 == "done")
test StorageWatcher:
@@ -174,7 +174,7 @@ test StorageWatcher:
send "attach-to 1" to p2
expect /attach-request 1 ([0-9]*)/ from p1 capture code1
expect /attach-response 1 ([0-9]*)/ from p2 capture code2
- guard code1 == code2
+ guard (code1 == code2)
send "attach-accept 1" to p1
send "attach-accept 1" to p2
diff --git a/test/sync.test b/test/sync.test
index 3830eb0..3cc7cba 100644
--- a/test/sync.test
+++ b/test/sync.test
@@ -22,7 +22,7 @@ test:
send "attach-to 1" to p2
expect /attach-request 1 ([0-9]*)/ from p1 capture code1
expect /attach-response 1 ([0-9]*)/ from p2 capture code2
- guard code1 == code2
+ guard (code1 == code2)
send "attach-accept 1" to p1
send "attach-accept 1" to p2