From fed1c2b6256543ff0bcfad319322bb2239fc470a Mon Sep 17 00:00:00 2001 From: kpouer Date: Tue, 5 Aug 2003 22:19:32 +0000 Subject: [PATCH 1/1] a junit Testcase to test the parser --- .../src/test/ParserTester.java | 26 ++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) create mode 100644 net.sourceforge.phpeclipse/src/test/ParserTester.java diff --git a/net.sourceforge.phpeclipse/src/test/ParserTester.java b/net.sourceforge.phpeclipse/src/test/ParserTester.java new file mode 100644 index 0000000..e9a4efc --- /dev/null +++ b/net.sourceforge.phpeclipse/src/test/ParserTester.java @@ -0,0 +1,26 @@ +package test; + +import junit.framework.TestCase; + + +/** + * A test for my php parser. + * to use it you have to switch PHPParser.PARSER_DEBUG to true and you can also switch the debugging flag + * of javaCC to true too (you have to regenerate the parser after that) + * Please never remove any test. If you find something that my parser do not handle correctly, + * you can tell me or add a test here. Thanks + * @author Matthieu Casanova + */ +public class ParserTester extends TestCase { + + public void testParser() throws Exception { + PHPParser parser = new PHPParser(); + parser.parseInfo(null,"'; ?>"); + parser.parseInfo(null,""); + parser.parseInfo(null,""); + parser.parseInfo(null,""); + parser.parseInfo(null,""); + parser.parseInfo(null,""); + parser.parseInfo(null,""); + } +} -- 1.7.1