From bacaad5a4090fc9baf6a1e78a87615020d646601 Mon Sep 17 00:00:00 2001 From: Tyler Kindy Date: Thu, 21 Jul 2022 16:26:09 -0400 Subject: [PATCH] Reorganize and rename tests --- .../interpret/JinjavaInterpreterTest.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/test/java/com/hubspot/jinjava/interpret/JinjavaInterpreterTest.java b/src/test/java/com/hubspot/jinjava/interpret/JinjavaInterpreterTest.java index 1b225e453..1cf32d973 100644 --- a/src/test/java/com/hubspot/jinjava/interpret/JinjavaInterpreterTest.java +++ b/src/test/java/com/hubspot/jinjava/interpret/JinjavaInterpreterTest.java @@ -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"); } }