google / jsonnet

Jsonnet - The data templating language
http://jsonnet.org
Apache License 2.0
6.97k stars 440 forks source link

issue with directory import test #530

Open asherikov opened 6 years ago

asherikov commented 6 years ago

https://github.com/google/jsonnet/blob/2caedc178adaf5de78fe7b8d3273a047bcf412f9/core/libjsonnet.cpp#L190 On some systems (FreeBSD) an attempt to import a directory with try_path() won't lead to a failure, and the error will be detected only by the lexer. For this reason one of the tests fails with something like this

FAIL (regex mismatch):  ../jsonnet  --ext-str var1=test --ext-code var2='{x:1,y:2}'  error.import_folder.jsonnet
This run's output:
STATIC ERROR: lib:1:2: Could not lex the character code 210
sparkprime commented 6 years ago

I think we'll probably have to do some #ifdef for various systems here, since there's no standard way to tell if a path is a directory.