33import org .hamcrest .AbstractMatcherTest ;
44import org .hamcrest .Matcher ;
55
6- import static org .hamcrest .text .IsEqualCompressingWhiteSpace .equalToCompressingWhiteSpace ;
76import static org .hamcrest .text .IsEqualCompressingWhiteSpace .*;
87
98public class IsEqualCompressingWhiteSpaceTest extends AbstractMatcherTest {
109
11- private final Matcher <String > matcher = equalToCompressingMIX (" Hello World how\n are we? " );
12- private final Matcher <String > SPACEmatcher = equalToCompressingSPACE (" Hello World how are we? " );
13- private final Matcher <String > TABmatcher = equalToCompressingTAB (" Hello World how\t are\t \t we? " );
14- private final Matcher <String > LINEFEEDmatcher = equalToCompressingLINEFEED (" Hello World how\n are we? " );
15- private final Matcher <String > FORMFEEDmatcher = equalToCompressingFORMFEED (" Hello World how\f are\f \f we? " );
16- private final Matcher <String > CARRIAGERETURNmatcher = equalToCompressingCARRIAGERETURN (" Hello \r World how \r \r are we? " );
10+ private final Matcher <String > matcher = equalToCompressingMix (" Hello World how\n are we? " );
11+ private final Matcher <String > SpaceMatcher = equalToCompressingSpace (" Hello World how are we? " );
12+ private final Matcher <String > TABmatcher = equalToCompressingTab (" Hello World how\t are\t \t we? " );
13+ private final Matcher <String > LineFeedMatcher = equalToCompressingLineFeed (" Hello World how\n are we? " );
14+ private final Matcher <String > FormFeedMatcher = equalToCompressingFormFeed (" Hello World how\f are\f \f we? " );
15+ private final Matcher <String > CarriageReturnMatcher = equalToCompressingCarriageReturn (" Hello \r World how \r \r are we? " );
1716
1817 @ Override
1918 protected Matcher <?> createMatcher () {
@@ -54,9 +53,9 @@ public void testPassesIfWhitespacesContainsNoBreakSpace() {
5453
5554 public void testFailsIfwordsAreSameButWhiteSpaceDiffers ()
5655 {
57- assertDoesNotMatch (SPACEmatcher , " Hello World how\n are we? " );
56+ assertDoesNotMatch (SpaceMatcher , " Hello World how\n are we? " );
5857 assertDoesNotMatch (TABmatcher , " Hello World how\n are we? " );
59- assertDoesNotMatch (LINEFEEDmatcher , " Hello World how\r are we? " );
58+ assertDoesNotMatch (LineFeedMatcher , " Hello World how\r are we? " );
6059 }
6160
6261 public void testPassesIfwordsAreSameButMixWhiteSpace ()
@@ -66,10 +65,10 @@ public void testPassesIfwordsAreSameButMixWhiteSpace()
6665
6766 public void testUnitWhiteSpace ()
6867 {
69- assertMatches (SPACEmatcher , " Hello World how are we? " );
68+ assertMatches (SpaceMatcher , " Hello World how are we? " );
7069 assertMatches (TABmatcher , " Hello World how \t are we? \t " );
71- assertMatches (LINEFEEDmatcher , " Hello World how\n are \n we? " );
72- assertMatches (FORMFEEDmatcher , " Hello World\f how are we? " );
73- assertMatches (CARRIAGERETURNmatcher , "Hello World how are we?" );
70+ assertMatches (LineFeedMatcher , " Hello World how\n are \n we? " );
71+ assertMatches (FormFeedMatcher , " Hello World\f how are we? " );
72+ assertMatches (CarriageReturnMatcher , "Hello World how are we?" );
7473 }
7574}
0 commit comments