@@ -314,7 +314,7 @@ def test_isomorphic_dfas(self):
314314 initial = "s0" ,
315315 accept = ["s1" ],
316316 )
317- assert are_isomorphic (fsa_user , fsa_sol ) == []
317+ assert are_isomorphic (fsa_user , fsa_sol ). ok
318318
319319
320320class TestEpsilonTransitions :
@@ -332,7 +332,7 @@ def test_valid_fsa_with_epsilon_unicode(self):
332332 initial = "q0" ,
333333 accept = ["q2" ],
334334 )
335- assert is_valid_fsa (fsa ) == []
335+ assert is_valid_fsa (fsa ). ok
336336
337337 def test_valid_fsa_with_epsilon_string (self ):
338338 """ε-NFA with 'epsilon' string should pass structural validation."""
@@ -346,7 +346,7 @@ def test_valid_fsa_with_epsilon_string(self):
346346 initial = "q0" ,
347347 accept = ["q2" ],
348348 )
349- assert is_valid_fsa (fsa ) == []
349+ assert is_valid_fsa (fsa ). ok
350350
351351 def test_valid_fsa_with_empty_string_epsilon (self ):
352352 """ε-NFA with empty string epsilon should pass structural validation."""
@@ -360,7 +360,7 @@ def test_valid_fsa_with_empty_string_epsilon(self):
360360 initial = "q0" ,
361361 accept = ["q2" ],
362362 )
363- assert is_valid_fsa (fsa ) == []
363+ assert is_valid_fsa (fsa ). ok
364364
365365 def test_epsilon_nfa_is_not_deterministic (self ):
366366 """ε-NFA should be flagged as non-deterministic."""
@@ -373,9 +373,9 @@ def test_epsilon_nfa_is_not_deterministic(self):
373373 initial = "q0" ,
374374 accept = ["q1" ],
375375 )
376- errors = is_deterministic (fsa )
377- assert len ( errors ) > 0
378- assert ErrorCode .NOT_DETERMINISTIC in [e .code for e in errors ]
376+ result = is_deterministic (fsa )
377+ assert not result . ok
378+ assert ErrorCode .NOT_DETERMINISTIC in [e .code for e in result . errors ]
379379
380380 def test_accepts_string_via_epsilon_closure (self ):
381381 """ε-NFA should accept 'a' by following q0 --ε--> q1 --a--> q2."""
@@ -389,7 +389,7 @@ def test_accepts_string_via_epsilon_closure(self):
389389 initial = "q0" ,
390390 accept = ["q2" ],
391391 )
392- assert accepts_string (fsa , "a" ) == []
392+ assert accepts_string (fsa , "a" ). ok
393393
394394 def test_rejects_string_with_epsilon_nfa (self ):
395395 """ε-NFA that accepts 'a' should reject empty string."""
@@ -403,8 +403,8 @@ def test_rejects_string_with_epsilon_nfa(self):
403403 initial = "q0" ,
404404 accept = ["q2" ],
405405 )
406- errors = accepts_string (fsa , "" )
407- assert len ( errors ) > 0
406+ result = accepts_string (fsa , "" )
407+ assert not result . ok
408408
409409 def test_accepts_empty_string_via_epsilon (self ):
410410 """ε-NFA should accept empty string when initial reaches accept via ε."""
@@ -417,7 +417,7 @@ def test_accepts_empty_string_via_epsilon(self):
417417 initial = "q0" ,
418418 accept = ["q1" ],
419419 )
420- assert accepts_string (fsa , "" ) == []
420+ assert accepts_string (fsa , "" ). ok
421421
422422 def test_epsilon_nfa_equivalent_to_dfa (self ):
423423 """ε-NFA and DFA accepting the same language should be equivalent."""
@@ -440,7 +440,7 @@ def test_epsilon_nfa_equivalent_to_dfa(self):
440440 initial = "s0" ,
441441 accept = ["s1" ],
442442 )
443- assert fsas_accept_same_language (enfa , dfa ) == []
443+ assert fsas_accept_same_language (enfa , dfa ). ok
444444
445445 def test_epsilon_nfa_not_equivalent_to_different_dfa (self ):
446446 """ε-NFA and DFA accepting different languages should not be equivalent."""
@@ -463,8 +463,8 @@ def test_epsilon_nfa_not_equivalent_to_different_dfa(self):
463463 initial = "s0" ,
464464 accept = ["s1" ],
465465 )
466- errors = fsas_accept_same_language (enfa , dfa )
467- assert len ( errors ) > 0
466+ result = fsas_accept_same_language (enfa , dfa )
467+ assert not result . ok
468468
469469 def test_multi_epsilon_nfa_equivalent_to_dfa (self ):
470470 """ε-NFA for (a|b) with branching epsilons should match equivalent DFA."""
@@ -491,7 +491,7 @@ def test_multi_epsilon_nfa_equivalent_to_dfa(self):
491491 initial = "s0" ,
492492 accept = ["s1" ],
493493 )
494- assert fsas_accept_same_language (enfa , dfa ) == []
494+ assert fsas_accept_same_language (enfa , dfa ). ok
495495
496496
497497if __name__ == "__main__" :
0 commit comments