@@ -157,14 +157,43 @@ Function test_message_logging($t : cs:C1710.Testing)
157157 $t .assert .areEqual ($t ; "Custom failure message" ; $mockTest .logMessages[0 ]; "Should log the provided message" )
158158
159159Function test_multiple_assertions ($t : cs:C1710 .Testing )
160- var $mockTest : cs:C1710 .Testing
161- $mockTest := cs:C1710 .Testing .new ()
160+ var $mockTest : cs:C1710 .Testing
161+ $mockTest := cs:C1710 .Testing .new ()
162162
163163 // Test multiple assertions accumulating messages
164164 $t .assert .areEqual ($mockTest ; 1 ; 2 ; "First failure" )
165165 $t .assert .areEqual ($mockTest ; "a" ; "b" ; "Second failure" )
166166
167- $t .assert .isTrue ($t ; $mockTest .failed; "Multiple failed assertions should mark test as failed" )
168- $t .assert .areEqual ($t ; 2 ; $mockTest .logMessages.length; "Should accumulate multiple failure messages" )
169- $t .assert .areEqual ($t ; "First failure" ; $mockTest .logMessages[0 ]; "Should store first message" )
170- $t .assert .areEqual ($t ; "Second failure" ; $mockTest .logMessages[1 ]; "Should store second message" )
167+ $t .assert .isTrue ($t ; $mockTest .failed; "Multiple failed assertions should mark test as failed" )
168+ $t .assert .areEqual ($t ; 2 ; $mockTest .logMessages.length; "Should accumulate multiple failure messages" )
169+ $t .assert .areEqual ($t ; "First failure" ; $mockTest .logMessages[0 ]; "Should store first message" )
170+ $t .assert .areEqual ($t ; "Second failure" ; $mockTest .logMessages[1 ]; "Should store second message" )
171+
172+ Function test_contains_with_text ($t : cs:C1710 .Testing )
173+ var $mockTest : cs:C1710 .Testing
174+ $mockTest := cs:C1710 .Testing .new ()
175+
176+ // Successful text containment
177+ $t .assert .contains ($mockTest ; "hello world" ; "world" ; "Should find substring" )
178+ $t .assert .isFalse ($t ; $mockTest .failed; "Valid substring should pass" )
179+
180+ // Failing text containment
181+ $mockTest := cs:C1710 .Testing .new ()
182+ $t .assert .contains ($mockTest ; "hello" ; "world" ; "Missing substring should fail" )
183+ $t .assert .isTrue ($t ; $mockTest .failed; "Missing substring should fail" )
184+
185+ Function test_contains_with_collection ($t : cs:C1710 .Testing )
186+ var $mockTest : cs:C1710 .Testing
187+ $mockTest := cs:C1710 .Testing .new ()
188+
189+ var $col : Collection
190+ $col := ["a"; "b"; "c"]
191+
192+ // Successful collection containment
193+ $t .assert .contains ($mockTest ; $col ; "b" ; "Should find element in collection" )
194+ $t .assert .isFalse ($t ; $mockTest .failed; "Existing element should pass" )
195+
196+ // Failing collection containment
197+ $mockTest := cs:C1710 .Testing .new ()
198+ $t .assert .contains ($mockTest ; $col ; "d" ; "Missing element should fail" )
199+ $t .assert .isTrue ($t ; $mockTest .failed; "Missing element should fail" )
0 commit comments