Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenamar-db committed Dec 30, 2024
1 parent 2df1a92 commit ca5ab6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion sjsonnet/src/sjsonnet/Materializer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ abstract class Materializer {
case Val.Null(pos) => storePos(pos); visitor.visitNull(-1)
case s: Val.Func =>
Error.fail("Couldn't manifest function with params [" + s.params.names.mkString(",") + "]", v.pos)
case vv: Val =>
Error.fail("Unknown value type " + vv.prettyName, vv.pos)
case _ =>
Error.fail("Unknown value type", v.pos)
Error.fail("Unknown value type " + v)
}
} catch {
case _: StackOverflowError =>
Expand Down
4 changes: 3 additions & 1 deletion sjsonnet/test/src-jvm/sjsonnet/ParseYamlTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ object ParseYamlTests extends TestSuite {
def tests: Tests = Tests {
test {
eval("std.parseYaml('foo: bar')") ==> ujson.Value("""{"foo":"bar"}""")
eval("std.parseYaml('- foo: bar')") ==> ujson.Value("""[{"foo":"bar"}]""")
}
test {
eval("std.parseYaml('')") ==> ujson.Value("""{}""")
}
eval("std.parseYaml(\"0777\")") ==> ujson.Value("""511""")
}
test {
eval("std.parseYaml('foo: bar\n---\nbar: baz\n')") ==> ujson.Value("""[{"foo": "bar"}, {"bar": "baz"}]""")
}
Expand Down

0 comments on commit ca5ab6c

Please sign in to comment.