1 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
---|
2 | * JFlex 1.4.3 *
|
---|
3 | * Copyright (C) 1998-2009 Gerwin Klein <[email protected]> *
|
---|
4 | * All rights reserved. *
|
---|
5 | * *
|
---|
6 | * This program is free software; you can redistribute it and/or modify *
|
---|
7 | * it under the terms of the GNU General Public License. See the file *
|
---|
8 | * COPYRIGHT for more information. *
|
---|
9 | * *
|
---|
10 | * This program is distributed in the hope that it will be useful, *
|
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
---|
13 | * GNU General Public License for more details. *
|
---|
14 | * *
|
---|
15 | * You should have received a copy of the GNU General Public License along *
|
---|
16 | * with this program; if not, write to the Free Software Foundation, Inc., *
|
---|
17 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
|
---|
18 | * *
|
---|
19 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
---|
20 |
|
---|
21 | package JFlex.tests;
|
---|
22 |
|
---|
23 | import JFlex.Emitter;
|
---|
24 | import junit.framework.TestCase;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * Some unit tests for the jflex Emitter class
|
---|
28 | *
|
---|
29 | * @author Gerwin Klein
|
---|
30 | * @version $Revision: 433 $, $Date: 2009-01-31 19:52:34 +1100 (Sat, 31 Jan 2009) $
|
---|
31 | */
|
---|
32 | public class EmitterTest extends TestCase {
|
---|
33 |
|
---|
34 | /**
|
---|
35 | * Constructor for EmitterTest.
|
---|
36 | * @param name the test name
|
---|
37 | */
|
---|
38 | public EmitterTest(String name) {
|
---|
39 | super(name);
|
---|
40 | }
|
---|
41 |
|
---|
42 | public void testJavadoc() {
|
---|
43 | StringBuffer usercode = new StringBuffer("/* some *** comment */");
|
---|
44 | assertTrue(!Emitter.endsWithJavadoc(usercode));
|
---|
45 | usercode.append("import bla; /** javadoc /* */ ");
|
---|
46 | assertTrue(Emitter.endsWithJavadoc(usercode));
|
---|
47 | usercode.append("bla");
|
---|
48 | assertTrue(!Emitter.endsWithJavadoc(usercode));
|
---|
49 | }
|
---|
50 | }
|
---|