1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
3 * Copyright (C) 1998-2004 Gerwin Klein <lsf@jflex.de> *
4 * All rights reserved. *
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. *
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. *
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 *
19 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24 import JFlex
.PackEmitter
;
25 import junit
.framework
.TestCase
;
30 * @author Gerwin Klein
31 * @version $Revision: 1.7 $, $Date: 2004/04/12 10:07:48 $
33 public class PackEmitterTest
extends TestCase
{
35 private PackEmitter p
;
39 * Constructor for PackEmitterTest.
41 public PackEmitterTest() {
42 super("PackEmitter test");
46 p
= new PackEmitter("Bla") {
47 public void emitUnpack() { }
51 public void testInit() {
54 " private static final int [] ZZ_BLA = zzUnpackBla();" + Out
.NL
+
56 " private static final String ZZ_BLA_PACKED_0 =" + Out
.NL
+
61 public void testEmitUCplain() {
65 assertEquals("\\10\\uff00", p
.toString());
68 public void testLineBreak() {
69 for (int i
= 0; i
< 36; i
++) {
73 System
.out
.println(p
);
75 "\\0\\1\\2\\3\\4\\5\\6\\7\\10\\11\\12\\13\\14\\15\\16\\17\"+"+Out
.NL
+
76 " \"\\20\\21\\22\\23\\24\\25\\26\\27\\30\\31\\32\\33\\34\\35\\36\\37\"+"+Out
.NL
+
77 " \"\\40\\41\\42\\43",