class TestCase::Literal::StringSingleQuote {
use TestCase::Minimal;
static method characters : int () {
# Characters
{
my $string = q'abc$d';
unless (length $string == 5) {
return 0;
}
unless ($string->[0] == 'a' && $string->[1] == 'b' && $string->[2] == 'c'&& $string->[3] == '$' && $string->[4] == 'd') {
return 0;
}
}
# Multi lines
{
my $str =
q'ab
cd
ef'
;
unless ($str eq "ab\ncd\nef") {
return 0;
}
}
return 1;
}
static method escape_character : int () {
# \\
{
my $string = q'\\';
unless (length $string == 1) {
return 0;
}
unless ($string->[0] == 0x5C) {
return 0;
}
}
# \'
{
my $string = q'\'';
unless (length $string == 1) {
return 0;
}
unless ($string->[0] == 0x27) {
return 0;
}
}
return 1;
}
}