Skip to content

Commit

Permalink
Reorganize and rename tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tkindy committed Jul 21, 2022
1 parent 61741a7 commit bacaad5
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -355,30 +355,30 @@ public void itBindsUnaryMinusTighterThanFilters() {
}

@Test
public void itBindsFiltersTighterThanMul() {
assertThat(interpreter.render("{{ (-5 * -4 | abs) }}")).isEqualTo("-20");
public void itBindsUnaryMinusTighterThanPlus() {
assertThat(interpreter.render("{{ -10 + 4 }}")).isEqualTo("-6");
assertThat(new Jinjava().render("{{ 4 + -10 }}", new HashMap<>())).isEqualTo("-6");
}

@Test
public void itInterpretsFilterChainsInOrder() {
assertThat(interpreter.render("{{ 'foo' | upper | replace('O', 'A') }}"))
.isEqualTo("FAA");
public void itBindsFiltersTighterThanMul() {
assertThat(interpreter.render("{{ (-5 * -4 | abs) }}")).isEqualTo("-20");
}

@Test
public void unaryMinusBindsTighterThanPlus() {
assertThat(interpreter.render("{{ -10 + 4 }}")).isEqualTo("-6");
assertThat(new Jinjava().render("{{ 4 + -10 }}", new HashMap<>())).isEqualTo("-6");
public void itBindsFiltersTighterThanPlus() {
assertThat(interpreter.render("{{ -10 | abs + 4 }}")).isEqualTo("14");
assertThat(interpreter.render("{{ 4 + -10 | abs }}")).isEqualTo("14");
}

@Test
public void filterChainsBindTighterThanPlus() {
assertThat(interpreter.render("{{ -10 | abs + 4 }}")).isEqualTo("14");
assertThat(interpreter.render("{{ 4 + -10 | abs }}")).isEqualTo("14");
public void itInterpretsFilterChainsInOrder() {
assertThat(interpreter.render("{{ 'foo' | upper | replace('O', 'A') }}"))
.isEqualTo("FAA");
}

@Test
public void standaloneNegativesParse() {
public void itInterpretsStandaloneNegatives() {
assertThat(interpreter.render("{{ -10 }}")).isEqualTo("-10");
}
}

0 comments on commit bacaad5

Please sign in to comment.