|
@@ -0,0 +1,33 @@
|
|
|
|
|
+using GLib;
|
|
|
|
|
+
|
|
|
|
|
+void jsonl_swallowed_error_tests() {
|
|
|
|
|
+
|
|
|
|
|
+ Test.add_func("/invercargill/json/jsonl/midstream_error_is_fatal_not_truncation", () => {
|
|
|
|
|
+ string exe;
|
|
|
|
|
+ if (Path.is_absolute(args_holder[0])) {
|
|
|
|
|
+ exe = args_holder[0];
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ exe = Path.build_filename(Environment.get_current_dir(), args_holder[0]);
|
|
|
|
|
+ }
|
|
|
|
|
+ assert_true(File.new_for_path(exe).query_exists());
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ string[] argv = { exe, "--jsonl-child" };
|
|
|
|
|
+ int status;
|
|
|
|
|
+ string child_stdout;
|
|
|
|
|
+ string child_stderr;
|
|
|
|
|
+ Process.spawn_sync(
|
|
|
|
|
+ null, argv, Environ.get(),
|
|
|
|
|
+ SpawnFlags.SEARCH_PATH,
|
|
|
|
|
+ null, out child_stdout, out child_stderr, out status);
|
|
|
|
|
+
|
|
|
|
|
+ assert_true(Process.if_signaled(status));
|
|
|
|
|
+ assert_true(child_stderr.contains("JsonlInputStream iteration failed"));
|
|
|
|
|
+ assert_false(child_stdout.contains("elements="));
|
|
|
|
|
+ }
|
|
|
|
|
+ catch (Error e) {
|
|
|
|
|
+ assert_no_error(e);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+}
|