+2014-12-07 Daiki Ueno <ueno@gnu.org>
+
+ tests: Improve test coverage of Vala scanner
+ * xgettext-vala-1: Test regex literal right after arithmetic
+ assignment operators, and the case '@' is not followed by a
+ template string.
+
2014-12-05 Daiki Ueno <ueno@gnu.org>
tests: Add more tests for integer overflow when reading MO file
var s6 = /_("This is a regex literal and must not be extracted!")\|/i;
+ var i1 = 1000;
+ i1 = 1 + /_("Regex literal after '+'")/.get_capture_count ();
+ i1 = 1 - /_("Regex literal after '-'")/.get_capture_count ();
+ i1 = 1 & /_("Regex literal after '-'")/.get_capture_count ();
+ i1 = 1 ^ /_("Regex literal after '^'")/.get_capture_count ();
+ if (1 < /_("Regex literal after '<'")/.get_capture_count ())
+ return 1;
+ if (1 <= /_("Regex literal after '<='")/.get_capture_count ())
+ return 1;
+ if (1 != /_("Regex literal after '!='")/.get_capture_count ())
+ return 1;
+ if (! /_("Regex literal after '!'")/.match(s1))
+ return 1;
+ if (true && /_("Regex literal after '&&'")/.match(s1))
+ return 1;
+ if (false || /_("Regex literal after '||'")/.match(s1))
+ return 1;
+
+ var r1 = true ? /_("Regex literal after '?'")/ :
+ /_("Regex literal after ':'")/;
+ var r2 = true ?? /_("Regex literal after '??'")/;
+ i1 += 1 << /_("Regex literal after '+='")/.get_capture_count ();
+ i1 *= /_("Regex literal after '*='")/.get_capture_count ();
+ i1 /= /_("Regex literal after '/='")/.get_capture_count ();
+ i1 %= /_("Regex literal after '%='")/.get_capture_count ();
+ i1 <<= /_("Regex literal after '<<='")/.get_capture_count ();
+ i1 |= /_("Regex literal after '|='")/.get_capture_count ();
+
+ i1++;
+ i1--;
+ i1 = i1 / i1;
+ GLib.Timeout.add (10, () => { return false; });
+
var d1 = 10e-1;
var d2 = 10E-1;
var s8 = _(@"This is a template string, which cannot be extracted!");
/* /= shouldn't start a regex literal */
- var i1 = 1000;
- i1 /= 10;
-
+ var i5 = 1000;
+ i5 /= 10;
+
return 0;
}
+
+class Foo : Object {
+ // @ isn't always followed by a template string.
+ public static Foo @new (void) {
+ return null;
+ }
+}
EOF
+cp xg-vala-1.vala ..
${XGETTEXT} --add-comments --no-location -o xg-vala-1.tmp xg-vala-1.vala 2>xg-vala-1.err
test $? = 0 || { cat xg-vala-1.err; exit 1; }
# Don't simplify this to "grep ... < xg-vala-1.tmp", otherwise OpenBSD 4.0 grep