From: K.Kosako Date: Thu, 6 Jul 2017 07:27:39 +0000 (+0900) Subject: add test cases for \R X-Git-Tag: v6.5.0^2~151 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=92ecb0d2aae2ead2cce3f5370dd2d009d090b4f5;p=onig add test cases for \R --- diff --git a/test/testc.c b/test/testc.c index fd803c8..c64300a 100644 --- a/test/testc.c +++ b/test/testc.c @@ -603,6 +603,12 @@ extern int main(int argc, char* argv[]) x2("(a)(?(1+0)b|c)d", "abd", 0, 3); x2("(?:(?'name'a)|(?'name'b))(?('name')c|d)e", "ace", 0, 3); x2("(?:(?'name'a)|(?'name'b))(?('name')c|d)e", "bce", 0, 3); + x2("\\R", "\r\n", 0, 2); + x2("\\R", "\r", 0, 1); + x2("\\R", "\n", 0, 1); + x2("\\R", "\x0b", 0, 1); + n("\\R\\n", "\r\n"); + n("\\R", "\xc2\x85"); // because euc-jp is not Unicode /* < ifndef IGNORE_EUC_JP > diff --git a/test/testu.c b/test/testu.c index 017ebef..2eabc0e 100644 --- a/test/testu.c +++ b/test/testu.c @@ -905,6 +905,15 @@ extern int main(int argc, char* argv[]) x2("\000^\000\\\000p\000{\000K\000a\000t\000a\000k\000a\000n\000a\000}\000$\000\000", "\060\277\000\000", 0, 2); x2("\000\\\000o\000{\0001\0000\0001\000}\000\000", "\000A\000\000", 0, 2); x2("\000\\\000o\000{\0001\0001\0000\0007\0002\0001\000}\000\000", "\221\321\000\000", 0, 2); + x2("\000\\\000R", "\000\015\000\012", 0, 4); // \R: general newline + x2("\000\\\000R", "\000\012", 0, 2); + x2("\000\\\000R", "\000\015", 0, 2); + x2("\000\\\000R", "\000\013", 0, 2); + n("\000\\\000R\000\012", "\000\015\000\012"); + x2("\000\\\000R", "\x00\x85", 0, 2); + x2("\000\\\000R", "\x20\x28", 0, 2); + x2("\000\\\000R", "\x20\x29", 0, 2); + n("\000\\\000R", "\x20\x2a"); fprintf(stdout, "\nRESULT SUCC: %d, FAIL: %d, ERROR: %d (by Oniguruma %s)\n",