Skip to content

Commit

Permalink
test: rename coalesce(x,y) alias in test_templater [NFC]
Browse files Browse the repository at this point in the history
Yuya added `coalesce()` as a built-in function with variable arity in
a2a9b7d, 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 <[email protected]>
Change-Id: I18593f64b9168fc334001c2ff5d49ad8d81c006d
  • Loading branch information
thoughtpolice committed Mar 28, 2024
1 parent 916dc30 commit c815aed
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions cli/tests/test_templater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)'
"###,
);

Expand Down Expand Up @@ -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"
"###);
Expand Down

0 comments on commit c815aed

Please sign in to comment.