|
|
|
@ -101,3 +101,18 @@ assert('\\\\n' == bs_bs_n, 'Four backslash broken before n') |
|
|
|
|
assert('\\\\\n' == bs_bs_nl, 'Five backslash broken before n') |
|
|
|
|
assert('\\\\' == bs_bs, 'Double-backslash broken') |
|
|
|
|
assert('\\' == bs, 'Backslash broken') |
|
|
|
|
|
|
|
|
|
mysubstring='foobarbaz' |
|
|
|
|
assert(mysubstring.substring() == 'foobarbaz', 'substring is broken') |
|
|
|
|
assert(mysubstring.substring(0) == 'foobarbaz', 'substring is broken') |
|
|
|
|
assert(mysubstring.substring(1) == 'oobarbaz', 'substring is broken') |
|
|
|
|
assert(mysubstring.substring(-5) == 'arbaz', 'substring is broken') |
|
|
|
|
assert(mysubstring.substring(1, 4) == 'oob', 'substring is broken') |
|
|
|
|
assert(mysubstring.substring(1,-5) == 'oob', 'substring is broken') |
|
|
|
|
assert(mysubstring.substring(1, 0) == '', 'substring is broken') |
|
|
|
|
assert(mysubstring.substring(0, 100) == 'foobarbaz', 'substring is broken') |
|
|
|
|
assert(mysubstring.substring(-1, -5) == '', 'substring is broken') |
|
|
|
|
assert(mysubstring.substring(10, -25) == '', 'substring is broken') |
|
|
|
|
assert(mysubstring.substring(-4, 2) == '', 'substring is broken') |
|
|
|
|
assert(mysubstring.substring(10, 9) == '', 'substring is broken') |
|
|
|
|
assert(mysubstring.substring(8, 10) == 'z', 'substring is broken') |
|
|
|
|