* Add test support for multi-file output.
* Add -update support for multi-file output tests.
* Add support for string output in multi-file output mode.
* Rename 'stringOutput' to 'stringOutputMode' to better express what it does
* Refactor main_test to make it less nested.
This also causes the -update flag to output a list of files which
have been updated. This does not include the paths which are deleted
for multi-file tests.
Change the dump code so that it hides the values of variable
definitions if they're large. This means that godoc.org should
be able to deal with the output, and the godoc output is
readable without needing to read through a huge struct literal definition.
Other approaches might be to always generate an extra variable
(seems unnecessary) or to pass to writer explicitly to the dump
methods rather than swapping s.w out temporarily. The former
seems unnecessarily intrusive to the usual output; the latter
seemed unnecessarily intrusive to the source itself.
YMMV.
Instead of reading the files directly for --tla/ext-*-file, just add a
code snippet that does an import or importstr.
This makes relative imports work when the code-file path is not in the
current directory. It also makes the import lazy so if the arg/var is
not referenced, the file does not have to exist.
Fixes: google/jsonnet#452
There was a trivial bug, which disabled caching
of parsed, desugared and analyzed code. So imports
were only cached on data level, not on executable
ast level.
This change will likely result in ~10x speedup
for some users.
It seems like it was broken on older compilers
since pregenerated stdlib AST.
It adds go 1.8.x to travis, so that we have a chance
of catching when our "known to work" no longer holds.
A step towards a unified test suite. In particular this
lets us use C++ version with Go tests. The problem remains
that errors (both static and runtime) may differ between implementations.
This will require special handling. C++ version seems to pass all
"positive" tests. Go version also has this problem (error formatter used in tests is different).
Also native functions etc. are not handled in any way at the moment.
EvaluateSnippetMulti comment was copied from another function by mistake.
Add a space between the license and the package name.
Add a few periods after the comments.
Fixesgoogle/go-jsonnet#160
The imports in "_gen.go" were not used, compiled, or
apparently useful so remove.
The color field in the ErrorFormatter was never set
to true and never used. This brought in many unused
dependencies including x/sys/unix that aren't ever
used. Move the color dependencies to the jsonnet main
package and set the colorized output there. Turn the
exported ErrorFormatter into an interface. In the future
it could be used to export JSON or HTML output.
Fixesgoogle/go-jsonnet#131