### ----------------------------------------------------
### -- ECMA262Regex
### -- Licenses: Artistic-2.0
### -- Authors: Jonathan Worthington, Alexander Kiryuhin
### -- File: t/30-facade.rakutest
### ----------------------------------------------------
use ECMA262Regex;
use Test;

plan 5;

nok ECMA262Regex.validate('\e'), 'Invalid regex returns False';
ok ECMA262Regex.validate('^fo+\n'), 'Valid regex returns True';

is ECMA262Regex.as-raku('^fo+\n'), '^\x66\x6F+\n', 'Regex is translated';

my $regex = ECMA262Regex.compile('^fo+\n');

ok "foo\n" ~~ $regex, 'Regex is compiled, successful check';
nok " foo\n" ~~ $regex, 'Regex is compiled, failed check';

# vim: expandtab shiftwidth=4


