1 package org.apache.maven.doxia.macro.snippet;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 import static org.junit.Assert.assertFalse;
22 import static org.junit.Assert.assertTrue;
23
24 import org.junit.Test;
25
26 public class SnippetReaderTest
27 {
28 @Test
29 public void testIsDemarcator()
30 {
31 String snippetId = "first";
32 String what = "START";
33 assertTrue( SnippetReader.isDemarcator( snippetId, what, "SNIPPET START first" ) );
34 assertTrue( SnippetReader.isDemarcator( snippetId, what, "SNIPPET start first" ) );
35 assertTrue( SnippetReader.isDemarcator( snippetId, what, "snippet START first" ) );
36 assertTrue( SnippetReader.isDemarcator( snippetId, what, "snippet start first" ) );
37 assertTrue( SnippetReader.isDemarcator( snippetId, what, "<!-- START SNIPPET: first -->" ) );
38
39 assertFalse( SnippetReader.isDemarcator( snippetId, what, "SNIPPET START First" ) );
40 assertFalse( SnippetReader.isDemarcator( snippetId, what, "SNIPPET START FIRST" ) );
41 assertFalse( SnippetReader.isDemarcator( snippetId, what, "SNIPPET START first_id" ) );
42 assertFalse( SnippetReader.isDemarcator( snippetId, what, "SNIPPET START id_first" ) );
43
44 }
45 }