From 5447941d9624adf881e8b32ec257d84593e8fb1a Mon Sep 17 00:00:00 2001 From: Devin Jean Date: Tue, 26 Sep 2023 22:41:50 -0500 Subject: [PATCH] test no empty variadic auto insert --- .../blocks/empty-variadic-no-auto-insert.xml | 1 + src/test/process.rs | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/test/blocks/empty-variadic-no-auto-insert.xml diff --git a/src/test/blocks/empty-variadic-no-auto-insert.xml b/src/test/blocks/empty-variadic-no-auto-insert.xml new file mode 100644 index 0000000..a7903b7 --- /dev/null +++ b/src/test/blocks/empty-variadic-no-auto-insert.xml @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/src/test/process.rs b/src/test/process.rs index ace12f4..486ca43 100644 --- a/src/test/process.rs +++ b/src/test/process.rs @@ -1589,6 +1589,28 @@ fn test_proc_explicit_to_string_cvt() { }); } +#[test] +fn test_proc_empty_variadic_no_auto_insert() { + let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC)); + let (mut env, _) = get_running_proc(&format!(include_str!("templates/generic-static.xml"), + globals = "", + fields = "", + funcs = include_str!("blocks/empty-variadic-no-auto-insert.xml"), + methods = "", + ), Settings::default(), system); + + run_till_term(&mut env, |mc, _, res| { + let expect = Value::from_json(mc, json!([ + [[], [], [], []], + [[], [], [], []], + [[], [], [], []], + [[], [], [], []], + [[], [], [], []], + ])).unwrap(); + assert_values_eq(&res.unwrap().0.unwrap(), &expect, 1e-5, "no auto insert"); + }); +} + #[test] fn test_proc_signed_zero() { let system = Rc::new(StdSystem::new_sync(BASE_URL.to_owned(), None, Config::default(), UtcOffset::UTC));