package com.rusticflare.markdown.utilities;

import static com.rusticflare.markdown.utilities.Strings.trimTrailingWhitspace;
import static org.assertj.core.api.SoftAssertions.assertSoftly;

import org.junit.Test;

public class StringsTest {

    @Test
    public void testTrimEnd() {
        assertSoftly(softly -> {
            softly.assertThat(trimTrailingWhitspace("")).isEmpty();
            softly.assertThat(trimTrailingWhitspace(" ")).isEmpty();
            softly.assertThat(trimTrailingWhitspace("text")).isEqualTo("text");
            softly.assertThat(trimTrailingWhitspace("\ntext")).isEqualTo("\ntext");
            softly.assertThat(trimTrailingWhitspace("\ntext\n")).isEqualTo("\ntext");
            softly.assertThat(trimTrailingWhitspace("\ntext\n ")).isEqualTo("\ntext");
        });
    }

}

@@ -273,11 +273,25 @@
 Trim
-End
+TrailingWhitspace
 () %7B
@@ -674,26 +674,24 @@
 gWhitspace(%22
-%5Cn
 text%5Cn%22)).is
@@ -691,34 +691,32 @@
 n%22)).isEqualTo(%22
-%5Cn
 text%22);%0A        
@@ -756,26 +756,24 @@
 gWhitspace(%22
-%5Cn
 text%5Cn %22)).i
@@ -774,34 +774,32 @@
  %22)).isEqualTo(%22
-%5Cn
 text%22);%0A        

Tidy StringsTest