#include "WireCellUtil/Persist.h"
#include "WireCellUtil/Testing.h"
#include "WireCellUtil/Exceptions.h"
#include <string>
#include <iostream>
#include <cmath>
#include <cstdlib>
Go to the source code of this file.
Definition at line 45 of file test_jsonnet.cxx.
49 "{person4: {name: \"Surley\", welcome:\"Don't call my Shirley\"}}"} };
52 cerr <<
"------give:\n";
54 cerr <<
"------got:\n";
56 cerr <<
"------want:\n";
62 cerr <<
"There should be errors following:\n";
67 cerr <<
"Properly caught reference to nonexistent extVar\n";
72 cerr <<
"test_jsonnet requires setting WIRECELL_PATH to point to where 'wirecell.jsonnet' exists\n";
79 const double mypi = 2*std::acos(0.0);
80 const double jspi = res[0].asDouble();
84 cerr <<
"Exercise Parser class:\n";
std::string evaluate_jsonnet_text(const std::string &text, const externalvars_t &extvar=externalvars_t(), const externalvars_t &extcode=externalvars_t())
std::map< std::string, std::string > externalvars_t
std::string getenv(std::string const &name)
The base wire cell exception.
QTextStream & endl(QTextStream &s)
Initial value:= R"(
std.mergePatch({
person1: {
name: "Alice",
welcome: "Hello " + self.name + "!",
},
person2: self.person1 { name: "Bob" },
person3: self.person1 { name: std.extVar("person") },
}, std.extVar("override"))
)"
Definition at line 14 of file test_jsonnet.cxx.
Initial value:= R"({
"person1": {
"name": "Alice",
"welcome": "Hello Alice!"
},
"person2": {
"name": "Bob",
"welcome": "Hello Bob!"
},
"person3": {
"name": "Malory",
"welcome": "Hello Malory!"
},
"person4": {
"name": "Surley",
"welcome": "Don't call my Shirley"
}
}
)"
Definition at line 24 of file test_jsonnet.cxx.