File tree Expand file tree Collapse file tree 6 files changed +66
-18
lines changed
cpp/ql/test/TestUtilities
csharp/ql/test/TestUtilities
java/ql/test/TestUtilities
ruby/ql/test/TestUtilities Expand file tree Collapse file tree 6 files changed +66
-18
lines changed Original file line number Diff line number Diff line change @@ -239,12 +239,20 @@ private string getColumnString(TColumn column) {
239239
240240/**
241241 * RegEx pattern to match a single expected result, not including the leading `$`. It consists of one or
242- * more comma-separated tags containing only letters, digits, `-` and `_` (note that the first character
243- * must not be a digit), optionally followed by `=` and the expected value.
242+ * more comma-separated tags optionally followed by `=` and the expected value.
243+ *
244+ * 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.
246+ *
247+ * Examples:
248+ * - `tag`
249+ * - `tag=value`
250+ * - `tag,tag2=value`
251+ * - `tag[foo bar]=value`
244252 */
245253private string expectationPattern ( ) {
246254 exists ( string tag , string tags , string value |
247- tag = "[A-Za-z-_][A-Za-z-_0-9]*" and
255+ tag = "[A-Za-z-_](?: [A-Za-z-_0-9]|\\[[^\\]]*\\]) *" and
248256 tags = "((?:" + tag + ")(?:\\s*,\\s*" + tag + ")*)" and
249257 // In Python, we allow both `"` and `'` for strings, as well as the prefixes `bru`.
250258 // For example, `b"foo"`.
Original file line number Diff line number Diff line change @@ -239,12 +239,20 @@ private string getColumnString(TColumn column) {
239239
240240/**
241241 * RegEx pattern to match a single expected result, not including the leading `$`. It consists of one or
242- * more comma-separated tags containing only letters, digits, `-` and `_` (note that the first character
243- * must not be a digit), optionally followed by `=` and the expected value.
242+ * more comma-separated tags optionally followed by `=` and the expected value.
243+ *
244+ * 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.
246+ *
247+ * Examples:
248+ * - `tag`
249+ * - `tag=value`
250+ * - `tag,tag2=value`
251+ * - `tag[foo bar]=value`
244252 */
245253private string expectationPattern ( ) {
246254 exists ( string tag , string tags , string value |
247- tag = "[A-Za-z-_][A-Za-z-_0-9]*" and
255+ tag = "[A-Za-z-_](?: [A-Za-z-_0-9]|\\[[^\\]]*\\]) *" and
248256 tags = "((?:" + tag + ")(?:\\s*,\\s*" + tag + ")*)" and
249257 // In Python, we allow both `"` and `'` for strings, as well as the prefixes `bru`.
250258 // For example, `b"foo"`.
Original file line number Diff line number Diff line change @@ -239,12 +239,20 @@ private string getColumnString(TColumn column) {
239239
240240/**
241241 * RegEx pattern to match a single expected result, not including the leading `$`. It consists of one or
242- * more comma-separated tags containing only letters, digits, `-` and `_` (note that the first character
243- * must not be a digit), optionally followed by `=` and the expected value.
242+ * more comma-separated tags optionally followed by `=` and the expected value.
243+ *
244+ * 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.
246+ *
247+ * Examples:
248+ * - `tag`
249+ * - `tag=value`
250+ * - `tag,tag2=value`
251+ * - `tag[foo bar]=value`
244252 */
245253private string expectationPattern ( ) {
246254 exists ( string tag , string tags , string value |
247- tag = "[A-Za-z-_][A-Za-z-_0-9]*" and
255+ tag = "[A-Za-z-_](?: [A-Za-z-_0-9]|\\[[^\\]]*\\]) *" and
248256 tags = "((?:" + tag + ")(?:\\s*,\\s*" + tag + ")*)" and
249257 // In Python, we allow both `"` and `'` for strings, as well as the prefixes `bru`.
250258 // For example, `b"foo"`.
Original file line number Diff line number Diff line change @@ -239,12 +239,20 @@ private string getColumnString(TColumn column) {
239239
240240/**
241241 * RegEx pattern to match a single expected result, not including the leading `$`. It consists of one or
242- * more comma-separated tags containing only letters, digits, `-` and `_` (note that the first character
243- * must not be a digit), optionally followed by `=` and the expected value.
242+ * more comma-separated tags optionally followed by `=` and the expected value.
243+ *
244+ * 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.
246+ *
247+ * Examples:
248+ * - `tag`
249+ * - `tag=value`
250+ * - `tag,tag2=value`
251+ * - `tag[foo bar]=value`
244252 */
245253private string expectationPattern ( ) {
246254 exists ( string tag , string tags , string value |
247- tag = "[A-Za-z-_][A-Za-z-_0-9]*" and
255+ tag = "[A-Za-z-_](?: [A-Za-z-_0-9]|\\[[^\\]]*\\]) *" and
248256 tags = "((?:" + tag + ")(?:\\s*,\\s*" + tag + ")*)" and
249257 // In Python, we allow both `"` and `'` for strings, as well as the prefixes `bru`.
250258 // For example, `b"foo"`.
Original file line number Diff line number Diff line change @@ -239,12 +239,20 @@ private string getColumnString(TColumn column) {
239239
240240/**
241241 * RegEx pattern to match a single expected result, not including the leading `$`. It consists of one or
242- * more comma-separated tags containing only letters, digits, `-` and `_` (note that the first character
243- * must not be a digit), optionally followed by `=` and the expected value.
242+ * more comma-separated tags optionally followed by `=` and the expected value.
243+ *
244+ * 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.
246+ *
247+ * Examples:
248+ * - `tag`
249+ * - `tag=value`
250+ * - `tag,tag2=value`
251+ * - `tag[foo bar]=value`
244252 */
245253private string expectationPattern ( ) {
246254 exists ( string tag , string tags , string value |
247- tag = "[A-Za-z-_][A-Za-z-_0-9]*" and
255+ tag = "[A-Za-z-_](?: [A-Za-z-_0-9]|\\[[^\\]]*\\]) *" and
248256 tags = "((?:" + tag + ")(?:\\s*,\\s*" + tag + ")*)" and
249257 // In Python, we allow both `"` and `'` for strings, as well as the prefixes `bru`.
250258 // For example, `b"foo"`.
Original file line number Diff line number Diff line change @@ -239,12 +239,20 @@ private string getColumnString(TColumn column) {
239239
240240/**
241241 * RegEx pattern to match a single expected result, not including the leading `$`. It consists of one or
242- * more comma-separated tags containing only letters, digits, `-` and `_` (note that the first character
243- * must not be a digit), optionally followed by `=` and the expected value.
242+ * more comma-separated tags optionally followed by `=` and the expected value.
243+ *
244+ * 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.
246+ *
247+ * Examples:
248+ * - `tag`
249+ * - `tag=value`
250+ * - `tag,tag2=value`
251+ * - `tag[foo bar]=value`
244252 */
245253private string expectationPattern ( ) {
246254 exists ( string tag , string tags , string value |
247- tag = "[A-Za-z-_][A-Za-z-_0-9]*" and
255+ tag = "[A-Za-z-_](?: [A-Za-z-_0-9]|\\[[^\\]]*\\]) *" and
248256 tags = "((?:" + tag + ")(?:\\s*,\\s*" + tag + ")*)" and
249257 // In Python, we allow both `"` and `'` for strings, as well as the prefixes `bru`.
250258 // For example, `b"foo"`.
You can’t perform that action at this time.
0 commit comments