Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nikoraes committed Jul 2, 2024
1 parent 0ad0519 commit 3414851
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions JexlNet.Test/ExtendedGrammar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,15 @@ public void Split()
Assert.True(JsonNode.DeepEquals(expected, result));
}

[Fact]
public void Join()
[Theory]
[InlineData("['foo','bar']|join('-')", "foo-bar")]
[InlineData("'f,b,a,d,e,c'|split(',')|sort|join", "a,b,c,d,e,f")]
[InlineData("'f,b,a,d,e,c'|split(',')|sort|join('')", "abcdef")]
public void Join(string expression, string expected)
{
var jexl = new Jexl(new ExtendedGrammar());
var result = jexl.Eval("['foo','bar']|join('-')");
Assert.Equal("foo-bar", result?.ToString());
var result = jexl.Eval(expression);
Assert.Equal(expected, result?.ToString());
}

[Theory]
Expand Down

0 comments on commit 3414851

Please sign in to comment.