Skip to content

Commit b65a10d

Browse files
committed
Inline Expectation Tests: sync
1 parent 5fb41e4 commit b65a10d

File tree

6 files changed

+36
-12
lines changed

6 files changed

+36
-12
lines changed

cpp/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,17 +242,21 @@ private string getColumnString(TColumn column) {
242242
* more comma-separated tags optionally followed by `=` and the expected value.
243243
*
244244
* Tags must be only letters, digits, `-` and `_` (note that the first character
245-
* must not be a digit), but can contain anything enclosed in a square brackets.
245+
* must not be a digit), but can contain anything enclosed in a single set of
246+
* square brackets.
246247
*
247248
* Examples:
248249
* - `tag`
249250
* - `tag=value`
250251
* - `tag,tag2=value`
251252
* - `tag[foo bar]=value`
253+
*
254+
* Not allowed:
255+
* - `tag[[[foo bar]`
252256
*/
253257
private string expectationPattern() {
254258
exists(string tag, string tags, string value |
255-
tag = "[A-Za-z-_](?:[A-Za-z-_0-9]|\\[[^\\]]*\\])*" and
259+
tag = "[A-Za-z-_](?:[A-Za-z-_0-9]|\\[[^\\]\\]]*\\])*" and
256260
tags = "((?:" + tag + ")(?:\\s*,\\s*" + tag + ")*)" and
257261
// In Python, we allow both `"` and `'` for strings, as well as the prefixes `bru`.
258262
// For example, `b"foo"`.

csharp/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,17 +242,21 @@ private string getColumnString(TColumn column) {
242242
* more comma-separated tags optionally followed by `=` and the expected value.
243243
*
244244
* Tags must be only letters, digits, `-` and `_` (note that the first character
245-
* must not be a digit), but can contain anything enclosed in a square brackets.
245+
* must not be a digit), but can contain anything enclosed in a single set of
246+
* square brackets.
246247
*
247248
* Examples:
248249
* - `tag`
249250
* - `tag=value`
250251
* - `tag,tag2=value`
251252
* - `tag[foo bar]=value`
253+
*
254+
* Not allowed:
255+
* - `tag[[[foo bar]`
252256
*/
253257
private string expectationPattern() {
254258
exists(string tag, string tags, string value |
255-
tag = "[A-Za-z-_](?:[A-Za-z-_0-9]|\\[[^\\]]*\\])*" and
259+
tag = "[A-Za-z-_](?:[A-Za-z-_0-9]|\\[[^\\]\\]]*\\])*" and
256260
tags = "((?:" + tag + ")(?:\\s*,\\s*" + tag + ")*)" and
257261
// In Python, we allow both `"` and `'` for strings, as well as the prefixes `bru`.
258262
// For example, `b"foo"`.

go/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,17 +242,21 @@ private string getColumnString(TColumn column) {
242242
* more comma-separated tags optionally followed by `=` and the expected value.
243243
*
244244
* Tags must be only letters, digits, `-` and `_` (note that the first character
245-
* must not be a digit), but can contain anything enclosed in a square brackets.
245+
* must not be a digit), but can contain anything enclosed in a single set of
246+
* square brackets.
246247
*
247248
* Examples:
248249
* - `tag`
249250
* - `tag=value`
250251
* - `tag,tag2=value`
251252
* - `tag[foo bar]=value`
253+
*
254+
* Not allowed:
255+
* - `tag[[[foo bar]`
252256
*/
253257
private string expectationPattern() {
254258
exists(string tag, string tags, string value |
255-
tag = "[A-Za-z-_](?:[A-Za-z-_0-9]|\\[[^\\]]*\\])*" and
259+
tag = "[A-Za-z-_](?:[A-Za-z-_0-9]|\\[[^\\]\\]]*\\])*" and
256260
tags = "((?:" + tag + ")(?:\\s*,\\s*" + tag + ")*)" and
257261
// In Python, we allow both `"` and `'` for strings, as well as the prefixes `bru`.
258262
// For example, `b"foo"`.

java/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,17 +242,21 @@ private string getColumnString(TColumn column) {
242242
* more comma-separated tags optionally followed by `=` and the expected value.
243243
*
244244
* Tags must be only letters, digits, `-` and `_` (note that the first character
245-
* must not be a digit), but can contain anything enclosed in a square brackets.
245+
* must not be a digit), but can contain anything enclosed in a single set of
246+
* square brackets.
246247
*
247248
* Examples:
248249
* - `tag`
249250
* - `tag=value`
250251
* - `tag,tag2=value`
251252
* - `tag[foo bar]=value`
253+
*
254+
* Not allowed:
255+
* - `tag[[[foo bar]`
252256
*/
253257
private string expectationPattern() {
254258
exists(string tag, string tags, string value |
255-
tag = "[A-Za-z-_](?:[A-Za-z-_0-9]|\\[[^\\]]*\\])*" and
259+
tag = "[A-Za-z-_](?:[A-Za-z-_0-9]|\\[[^\\]\\]]*\\])*" and
256260
tags = "((?:" + tag + ")(?:\\s*,\\s*" + tag + ")*)" and
257261
// In Python, we allow both `"` and `'` for strings, as well as the prefixes `bru`.
258262
// For example, `b"foo"`.

ql/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,17 +242,21 @@ private string getColumnString(TColumn column) {
242242
* more comma-separated tags optionally followed by `=` and the expected value.
243243
*
244244
* Tags must be only letters, digits, `-` and `_` (note that the first character
245-
* must not be a digit), but can contain anything enclosed in a square brackets.
245+
* must not be a digit), but can contain anything enclosed in a single set of
246+
* square brackets.
246247
*
247248
* Examples:
248249
* - `tag`
249250
* - `tag=value`
250251
* - `tag,tag2=value`
251252
* - `tag[foo bar]=value`
253+
*
254+
* Not allowed:
255+
* - `tag[[[foo bar]`
252256
*/
253257
private string expectationPattern() {
254258
exists(string tag, string tags, string value |
255-
tag = "[A-Za-z-_](?:[A-Za-z-_0-9]|\\[[^\\]]*\\])*" and
259+
tag = "[A-Za-z-_](?:[A-Za-z-_0-9]|\\[[^\\]\\]]*\\])*" and
256260
tags = "((?:" + tag + ")(?:\\s*,\\s*" + tag + ")*)" and
257261
// In Python, we allow both `"` and `'` for strings, as well as the prefixes `bru`.
258262
// For example, `b"foo"`.

ruby/ql/test/TestUtilities/InlineExpectationsTest.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,17 +242,21 @@ private string getColumnString(TColumn column) {
242242
* more comma-separated tags optionally followed by `=` and the expected value.
243243
*
244244
* Tags must be only letters, digits, `-` and `_` (note that the first character
245-
* must not be a digit), but can contain anything enclosed in a square brackets.
245+
* must not be a digit), but can contain anything enclosed in a single set of
246+
* square brackets.
246247
*
247248
* Examples:
248249
* - `tag`
249250
* - `tag=value`
250251
* - `tag,tag2=value`
251252
* - `tag[foo bar]=value`
253+
*
254+
* Not allowed:
255+
* - `tag[[[foo bar]`
252256
*/
253257
private string expectationPattern() {
254258
exists(string tag, string tags, string value |
255-
tag = "[A-Za-z-_](?:[A-Za-z-_0-9]|\\[[^\\]]*\\])*" and
259+
tag = "[A-Za-z-_](?:[A-Za-z-_0-9]|\\[[^\\]\\]]*\\])*" and
256260
tags = "((?:" + tag + ")(?:\\s*,\\s*" + tag + ")*)" and
257261
// In Python, we allow both `"` and `'` for strings, as well as the prefixes `bru`.
258262
// For example, `b"foo"`.

0 commit comments

Comments
 (0)