|
| 1 | +[ |
| 2 | + { |
| 3 | + "input": "${a.b}", |
| 4 | + "is_pure_ref": true, |
| 5 | + "path": "a.b", |
| 6 | + "comment": "simple two-segment path" |
| 7 | + }, |
| 8 | + { |
| 9 | + "input": "${a.b.c}", |
| 10 | + "is_pure_ref": true, |
| 11 | + "path": "a.b.c", |
| 12 | + "comment": "three-segment path" |
| 13 | + }, |
| 14 | + { |
| 15 | + "input": "${a.b[0].c}", |
| 16 | + "is_pure_ref": true, |
| 17 | + "path": "a.b[0].c", |
| 18 | + "comment": "path with index" |
| 19 | + }, |
| 20 | + { |
| 21 | + "input": "${a[0]}", |
| 22 | + "is_pure_ref": true, |
| 23 | + "path": "a[0]", |
| 24 | + "comment": "single key with index" |
| 25 | + }, |
| 26 | + { |
| 27 | + "input": "${a.b[0][1]}", |
| 28 | + "is_pure_ref": true, |
| 29 | + "path": "a.b[0][1]", |
| 30 | + "comment": "path with multiple indices" |
| 31 | + }, |
| 32 | + { |
| 33 | + "input": "${a.b-c}", |
| 34 | + "is_pure_ref": true, |
| 35 | + "path": "a.b-c", |
| 36 | + "comment": "hyphen in key" |
| 37 | + }, |
| 38 | + { |
| 39 | + "input": "${a.b_c}", |
| 40 | + "is_pure_ref": true, |
| 41 | + "path": "a.b_c", |
| 42 | + "comment": "underscore in key" |
| 43 | + }, |
| 44 | + { |
| 45 | + "input": "${resources.jobs.my-job.id}", |
| 46 | + "is_pure_ref": true, |
| 47 | + "path": "resources.jobs.my-job.id", |
| 48 | + "comment": "typical resource reference" |
| 49 | + }, |
| 50 | + { |
| 51 | + "input": "${var.my_var}", |
| 52 | + "is_pure_ref": true, |
| 53 | + "path": "var.my_var", |
| 54 | + "comment": "typical variable reference" |
| 55 | + }, |
| 56 | + { |
| 57 | + "input": "${a}", |
| 58 | + "is_pure_ref": true, |
| 59 | + "path": "a", |
| 60 | + "comment": "single key" |
| 61 | + }, |
| 62 | + { |
| 63 | + "input": "hello", |
| 64 | + "is_pure_ref": false, |
| 65 | + "comment": "plain string, no reference" |
| 66 | + }, |
| 67 | + { |
| 68 | + "input": "${a} ${b}", |
| 69 | + "is_pure_ref": false, |
| 70 | + "comment": "multiple references, not pure" |
| 71 | + }, |
| 72 | + { |
| 73 | + "input": "pre ${a.b} post", |
| 74 | + "is_pure_ref": false, |
| 75 | + "comment": "reference with surrounding text" |
| 76 | + }, |
| 77 | + { |
| 78 | + "input": "${a}${b}", |
| 79 | + "is_pure_ref": false, |
| 80 | + "comment": "adjacent references, not pure" |
| 81 | + }, |
| 82 | + { |
| 83 | + "input": "", |
| 84 | + "is_pure_ref": false, |
| 85 | + "comment": "empty string" |
| 86 | + }, |
| 87 | + { |
| 88 | + "input": "${}", |
| 89 | + "is_pure_ref": false, |
| 90 | + "comment": "empty reference" |
| 91 | + }, |
| 92 | + { |
| 93 | + "input": "${a.b", |
| 94 | + "is_pure_ref": false, |
| 95 | + "comment": "unterminated reference" |
| 96 | + }, |
| 97 | + { |
| 98 | + "input": "${foo.bar-}", |
| 99 | + "is_pure_ref": false, |
| 100 | + "comment": "trailing hyphen in key" |
| 101 | + }, |
| 102 | + { |
| 103 | + "input": "${foo..bar}", |
| 104 | + "is_pure_ref": false, |
| 105 | + "comment": "double dot in path" |
| 106 | + }, |
| 107 | + { |
| 108 | + "input": "${0foo}", |
| 109 | + "is_pure_ref": false, |
| 110 | + "comment": "leading digit in key" |
| 111 | + }, |
| 112 | + { |
| 113 | + "input": "${foo. bar}", |
| 114 | + "is_pure_ref": false, |
| 115 | + "comment": "space in path" |
| 116 | + }, |
| 117 | + { |
| 118 | + "input": "${foo.bar!}", |
| 119 | + "is_pure_ref": false, |
| 120 | + "comment": "special char in key" |
| 121 | + }, |
| 122 | + { |
| 123 | + "input": "${foo.bar_}", |
| 124 | + "is_pure_ref": false, |
| 125 | + "comment": "trailing underscore in key" |
| 126 | + }, |
| 127 | + { |
| 128 | + "input": "${foo._bar}", |
| 129 | + "is_pure_ref": false, |
| 130 | + "comment": "underscore-prefixed segment" |
| 131 | + }, |
| 132 | + { |
| 133 | + "input": "$x", |
| 134 | + "is_pure_ref": false, |
| 135 | + "comment": "dollar without brace" |
| 136 | + }, |
| 137 | + { |
| 138 | + "input": "abc$", |
| 139 | + "is_pure_ref": false, |
| 140 | + "comment": "trailing dollar" |
| 141 | + } |
| 142 | +] |
0 commit comments