From c815aede8d203bcabf006a4096f7e399e9629247 Mon Sep 17 00:00:00 2001 From: Austin Seipp Date: Wed, 27 Mar 2024 22:08:32 -0500 Subject: [PATCH] test: rename `coalesce(x,y)` alias in `test_templater` [NFC] Yuya added `coalesce()` as a built-in function with variable arity in a2a9b7decb586, and we want to use it with more-than-two arguments in the default `log_node` configuration in order to provide better graph node symbols for users. However, `test_templater` already defined this name as an alias, but with only two parameters; this alias now conflicts with the built-in definition and overrides it, causing the test to fail catastrophically because now the default configuration is considered invalid. Simply renaming it fixes this without invalidating the actual test case. Signed-off-by: Austin Seipp Change-Id: I18593f64b9168fc334001c2ff5d49ad8d81c006d --- cli/tests/test_templater.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cli/tests/test_templater.rs b/cli/tests/test_templater.rs index cc076c9fe5..5c6869f65d 100644 --- a/cli/tests/test_templater.rs +++ b/cli/tests/test_templater.rs @@ -147,7 +147,7 @@ fn test_templater_alias() { 'recurse1' = 'recurse2()' 'recurse2()' = 'recurse' 'identity(x)' = 'x' - 'coalesce(x, y)' = 'if(x, x, y)' + 'if_non_null(x, y)' = 'if(x, x, y)' "###, ); @@ -259,19 +259,19 @@ fn test_templater_alias() { = Function "identity": Expected 1 arguments "###); - insta::assert_snapshot!(render_err(r#"coalesce(label("x", "not boolean"), "")"#), @r###" - Error: Failed to parse template: Alias "coalesce()" cannot be expanded + insta::assert_snapshot!(render_err(r#"if_non_null(label("x", "not boolean"), "")"#), @r###" + Error: Failed to parse template: Alias "if_non_null()" cannot be expanded Caused by: 1: --> 1:1 | - 1 | coalesce(label("x", "not boolean"), "") - | ^-------------------------------------^ + 1 | if_non_null(label("x", "not boolean"), "") + | ^----------------------------------------^ | - = Alias "coalesce()" cannot be expanded - 2: --> 1:10 + = Alias "if_non_null()" cannot be expanded + 2: --> 1:13 | - 1 | coalesce(label("x", "not boolean"), "") - | ^-----------------------^ + 1 | if_non_null(label("x", "not boolean"), "") + | ^-----------------------^ | = Expected expression of type "Boolean" "###);