Skip to content

Commit 55bcb26

Browse files
committed
Add regression test for another super bug.
1 parent 1c51f11 commit 55bcb26

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

sjsonnet/test/src/sjsonnet/EvaluatorTests.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,21 @@ object EvaluatorTests extends TestSuite {
194194
|""".stripMargin,
195195
useNewEvaluator = useNewEvaluator
196196
) ==> ujson.Obj("x" -> ujson.Num(3))
197+
// Yet another related bug involving super references _not_ in locals:
198+
eval(
199+
"""
200+
|local lib = {
201+
| foo():: {
202+
| [k]: super.x + 1
203+
| for k in ["x"]
204+
| },
205+
|};
206+
|
207+
|{ x: 2 }
208+
|+ lib.foo()
209+
|""".stripMargin,
210+
useNewEvaluator = useNewEvaluator
211+
) ==> ujson.Obj("x" -> ujson.Num(3))
197212
// Regression test for a bug in handling of non-string field names:
198213
evalErr("{[k]: k for k in [1]}", useNewEvaluator = useNewEvaluator) ==>
199214
"""sjsonnet.Error: Field name must be string or null, not number

0 commit comments

Comments
 (0)