File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -644,10 +644,22 @@ TEST_CASE("oneleet - no leet candidates returns unchanged", "[transforms]")
644644 REQUIRE (nng_test_access::oneleet (L" hymn" ) == L" hymn" );
645645}
646646
647- TEST_CASE (" allleet - replaces all possible characters" , " [transforms]" )
647+ TEST_CASE (" allleet - replaces at most 2 characters" , " [transforms]" )
648648{
649649 auto result = nng_test_access::allleet (L" test" );
650- REQUIRE (result == L" 7327" ); // t->7, e->3, s->2, t->7
650+ // With max 2 replacements, exactly 2 of the 4 leet-mappable chars change.
651+ int changed = 0 ;
652+ std::wstring original = L" test" ;
653+ for (std::size_t i = 0 ; i < original.size (); ++i)
654+ {
655+ if (result[i] != original[i])
656+ {
657+ ++changed;
658+ }
659+ }
660+ REQUIRE (result.size () == original.size ());
661+ REQUIRE (changed <= 2 );
662+ REQUIRE (changed > 0 );
651663}
652664
653665// ---------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments