Package com.github.maven_nar.cpptasks.parser

Examples of com.github.maven_nar.cpptasks.parser.CParser


   * @throws IOException test fails on IOException
   */
  public void testImmediateImportBracket() throws IOException {
    CharArrayReader reader = new CharArrayReader(
        "#import <foo.h> nowhatever  ".toCharArray());
    CParser parser = new CParser();
    parser.parse(reader);
    String[] includes = parser.getIncludes();
    assertEquals(includes.length, 1);
    assertEquals("foo.h", includes[0]);
  }
View Full Code Here


   * @throws IOException test fails on IOException
   */
  public void testImmediateImportQuote() throws IOException {
    CharArrayReader reader = new CharArrayReader("#import \"foo.h\"   "
                                                 .toCharArray());
    CParser parser = new CParser();
    parser.parse(reader);
    String[] includes = parser.getIncludes();
    assertEquals(includes.length, 1);
    assertEquals("foo.h", includes[0]);
  }
View Full Code Here

   * @throws IOException test fails on IOException
   */
  public void testImmediateIncludeBracket() throws IOException {
    CharArrayReader reader = new CharArrayReader("#include      <foo.h>   "
                                                 .toCharArray());
    CParser parser = new CParser();
    parser.parse(reader);
    String[] includes = parser.getIncludes();
    assertEquals(includes.length, 1);
    assertEquals("foo.h", includes[0]);
  }
View Full Code Here

   * @throws IOException test fails on IOException.
   */
  public void testImmediateIncludeQuote() throws IOException {
    CharArrayReader reader = new CharArrayReader(
        "#include     \"foo.h\"   ".toCharArray());
    CParser parser = new CParser();
    parser.parse(reader);
    String[] includes = parser.getIncludes();
    assertEquals(includes.length, 1);
    assertEquals("foo.h", includes[0]);
  }
View Full Code Here

   * @throws IOException test fails on IOException
   */
  public void testIncompleteImmediateImportBracket() throws IOException {
    CharArrayReader reader = new CharArrayReader("#import <foo.h   "
                                                 .toCharArray());
    CParser parser = new CParser();
    parser.parse(reader);
    String[] includes = parser.getIncludes();
    assertEquals(includes.length, 0);
  }
View Full Code Here

   * @throws IOException test fails on IOException
   */
  public void testIncompleteImmediateImportQuote() throws IOException {
    CharArrayReader reader = new CharArrayReader("#import \"foo.h   "
                                                 .toCharArray());
    CParser parser = new CParser();
    parser.parse(reader);
    String[] includes = parser.getIncludes();
    assertEquals(includes.length, 0);
  }
View Full Code Here

   * @throws IOException test fails on IOException
   */
  public void testIncompleteImmediateIncludeBracket() throws IOException {
    CharArrayReader reader = new CharArrayReader("#include <foo.h   "
                                                 .toCharArray());
    CParser parser = new CParser();
    parser.parse(reader);
    String[] includes = parser.getIncludes();
    assertEquals(includes.length, 0);
  }
View Full Code Here

   * @throws IOException test fails on IOException
   */
  public void testIncompleteImmediateIncludeQuote() throws IOException {
    CharArrayReader reader = new CharArrayReader("#include     \"foo.h    "
                                                 .toCharArray());
    CParser parser = new CParser();
    parser.parse(reader);
    String[] includes = parser.getIncludes();
    assertEquals(includes.length, 0);
  }
View Full Code Here

   * @throws IOException test fails on IOException
   */
  public void testNoQuoteOrBracket() throws IOException {
    CharArrayReader reader = new CharArrayReader("#include foo.h  "
                                                 .toCharArray());
    CParser parser = new CParser();
    parser.parse(reader);
    String[] includes = parser.getIncludes();
    assertEquals(includes.length, 0);
  }
View Full Code Here

   * @throws IOException test fails on IOException
   */
  public void testNotFirstWhitespace() throws IOException {
    CharArrayReader reader = new CharArrayReader("//#include \"foo.h\""
                                                 .toCharArray());
    CParser parser = new CParser();
    parser.parse(reader);
    String[] includes = parser.getIncludes();
    assertEquals(includes.length, 0);
  }
View Full Code Here

TOP

Related Classes of com.github.maven_nar.cpptasks.parser.CParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.