jrsonnet icon indicating copy to clipboard operation
jrsonnet copied to clipboard

Error statement executes unexpectedly

Open Duologic opened this issue 9 months ago • 1 comments

From https://github.com/google/go-jsonnet/blob/master/testdata/std.filter7.jsonnet

std.filter(function(n) false, [error "xxx"])
➜ cjsonnet ./go-jsonnet-test/vendor/testdata/std.filter7.jsonnet
[ ]

➜ jsonnet ./go-jsonnet-test/vendor/testdata/std.filter7.jsonnet
[ ]

➜ jrsonnet ./go-jsonnet-test/vendor/testdata/std.filter7.jsonnet
runtime error: xxx
    go-jsonnet-test/vendor/github.com/google/go-jsonnet/testdata/std.filter7.jsonnet:1:32-44: error statement
    go-jsonnet-test/vendor/github.com/google/go-jsonnet/testdata/std.filter7.jsonnet:1:1-46:  function <builtin_filter> call

Duologic avatar May 17 '25 20:05 Duologic

I need to re-sync my standard tests status, or better yet, add them to automatic testing.

I have done it manually before, as the golden tests often didn't match jrsonnet output due to differences in manifestification/stack trace formats, but now I can just add tests from upstream to the list of jrsonnet own snapshot testing.

In this case, builtin_filter should be split to lazy-eager switch as I done for many other functions in #193

CertainLach avatar May 19 '25 07:05 CertainLach