You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ./cairo-tests/src/byte_array_test.cairo// TODO: segfault
#[test]
#[ignore]
fntest_reverse() {
// Arrays of length < 16letba:ByteArray="abc";
letba_rev:ByteArray="cba";
letpalindrome:ByteArray="rotator";
assert_ne(@ba, @ba.rev(), 'ba == ba.rev()');
assert_ne(@ba_rev, @ba_rev.rev(), 'ba_rev == ba_rev.rev()');
assert_eq(@ba, @ba_rev.rev(), 'ba != ba_rev.rev()');
assert_eq(@palindrome, @palindrome.rev(), 'palindrome is not a palindrome');
// Arrays of length 16letba:ByteArray="my length is 16.";
letba_rev:ByteArray=".61 si htgnel ym";
letpalindrome:ByteArray="nolemon nomelon";
assert_ne(@ba, @ba.rev(), 'ba == ba.rev()');
assert_ne(@ba_rev, @ba_rev.rev(), 'ba_rev == ba_rev.rev()');
assert_eq(@ba, @ba_rev.rev(), 'ba != ba_rev.rev()');
assert_eq(@palindrome, @palindrome.rev(), 'palindrome is not a palindrome');
// Arrays of 16 < length < 31letba:ByteArray="I am a medium byte array";
letba_rev:ByteArray="yarra etyb muidem a ma I";
letpalindrome:ByteArray="nolemon nomelon";
assert_ne(@ba, @ba.rev(), 'ba == ba.rev()');
assert_ne(@ba_rev, @ba_rev.rev(), 'ba_rev == ba_rev.rev()');
assert_eq(@ba, @ba_rev.rev(), 'ba != ba_rev.rev()');
assert_eq(@palindrome, @palindrome.rev(), 'palindrome is not a palindrome');
// Arrays of length 31letba:ByteArray="I didn't find a good palindrome";
letba_rev:ByteArray="emordnilap doog a dnif t'ndid I";
letpalindrome:ByteArray="kayak level rotator level kayak";
assert_ne(@ba, @ba.rev(), 'ba == ba.rev()');
assert_ne(@ba_rev, @ba_rev.rev(), 'ba_rev == ba_rev.rev()');
assert_eq(@ba, @ba_rev.rev(), 'ba != ba_rev.rev()');
assert_eq(@palindrome, @palindrome.rev(), 'palindrome is not a palindrome');
// Arrays of 31 < length < 47 (31+16)letba:ByteArray="This time I did find a good palindrome!";
letba_rev:ByteArray="!emordnilap doog a dnif did I emit sihT";
letpalindrome:ByteArray="noitneverpropagatesifisetagaporprevention";
assert_ne(@ba, @ba.rev(), 'ba == ba.rev()');
assert_ne(@ba_rev, @ba_rev.rev(), 'ba_rev == ba_rev.rev()');
assert_eq(@ba, @ba_rev.rev(), 'ba != ba_rev.rev()');
assert_eq(@palindrome, @palindrome.rev(), 'palindrome is not a palindrome');
// Arrays of length 47 (31+16)letba:ByteArray="I have found a palindrome, exactly 47 in length";
letba_rev:ByteArray="htgnel ni 74 yltcaxe ,emordnilap a dnuof evah I";
letpalindrome:ByteArray="onacloverifaliveeruptsavastpureevilafirevolcano";
assert_ne(@ba, @ba.rev(), 'ba == ba.rev()');
assert_ne(@ba_rev, @ba_rev.rev(), 'ba_rev == ba_rev.rev()');
assert_eq(@ba, @ba_rev.rev(), 'ba != ba_rev.rev()');
assert_eq(@palindrome, @palindrome.rev(), 'palindrome is not a palindrome');
// Arrays of length > 47 (31+16)letba:ByteArray="This palindrome is not as good, but at least it's long enough";
letba_rev:ByteArray="hguone gnol s'ti tsael ta tub ,doog sa ton si emordnilap sihT";
letpalindrome:ByteArray="docnoteidissentafastneverpreventsafatnessidietoncod";
assert_ne(@ba, @ba.rev(), 'ba == ba.rev()');
assert_ne(@ba_rev, @ba_rev.rev(), 'ba_rev == ba_rev.rev()');
assert_eq(@ba, @ba_rev.rev(), 'ba != ba_rev.rev()');
assert_eq(@palindrome, @palindrome.rev(), 'palindrome is not a palindrome');
}
The text was updated successfully, but these errors were encountered:
Likely related to spans?
The text was updated successfully, but these errors were encountered: