@@ -0,0 +1,2758 @@
+package com.novoda.sqlite.impl;%0A%0Aimport java.io.IOException;%0Aimport java.io.StringReader;%0Aimport java.util.List;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Apublic class SQLFileTest %7B%0A    private final static String STATEMENT_CREATE_TABLE = %22CREATE TABLE banana(_id INTEGER);%22;%0A    private final static String STATEMENT_ALTER_TABLE = %22ALTER TABLE banana ADD COLUMN colour TEXT;%22;%0A    private final static String NEW_LINE = %22%5Cn%22;%0A    private final static String SPACE = %22 %22;%0A    private final static String LINE_COMMENT = %22-- this is a line comment%22;%0A    private final static String%5B%5D EXPECTED_STATEMENTS = new String%5B%5D%7BSTATEMENT_CREATE_TABLE, STATEMENT_ALTER_TABLE%7D;%0A    private static final String BLOCK_COMMENT = %22/* this is a %5Cn block comment %5Cn spanning over %5Cn multiple lines */%22;%0A%0A    @Test%0A    public void givenSQLFile_whenParseAndGetStatements_thenGetCorrectStatements() throws IOException %7B%0A        SQLFile file = givenSQLFileParsedFromString(STATEMENT_CREATE_TABLE + NEW_LINE + STATEMENT_ALTER_TABLE);%0A%0A        String%5B%5D actual = getStatementsFromFile(file);%0A%0A        Assert.assertArrayEquals(actual, EXPECTED_STATEMENTS);%0A    %7D%0A%0A    @Test%0A    public void givenSQLFileWithSpaces_whenParseAndGetStatements_thenGetCorrectTrimmedStatements() throws IOException %7B%0A        SQLFile file = givenSQLFileParsedFromString(SPACE + STATEMENT_CREATE_TABLE + SPACE + NEW_LINE + SPACE + STATEMENT_ALTER_TABLE + SPACE);%0A%0A        String%5B%5D actual = getStatementsFromFile(file);%0A%0A        Assert.assertArrayEquals(actual, EXPECTED_STATEMENTS);%0A    %7D%0A%0A    @Test%0A    public void givenSQLFileWithLineComments_whenParseAndGetStatements_thenIgnoreComments() throws IOException %7B%0A        SQLFile file = givenSQLFileParsedFromString(%0A                STATEMENT_CREATE_TABLE + SPACE + LINE_COMMENT + NEW_LINE + STATEMENT_ALTER_TABLE + SPACE + LINE_COMMENT);%0A%0A        String%5B%5D actual = getStatementsFromFile(file);%0A%0A        Assert.assertArrayEquals(actual, EXPECTED_STATEMENTS);%0A    %7D%0A%0A    @Test%0A    public void givenSQLFileWithBlockComments_whenParseAndGetStatements_thenIgnoreComments() throws IOException %7B%0A        SQLFile file = givenSQLFileParsedFromString(%0A                STATEMENT_CREATE_TABLE + NEW_LINE + BLOCK_COMMENT + NEW_LINE + STATEMENT_ALTER_TABLE);%0A%0A        String%5B%5D actual = getStatementsFromFile(file);%0A%0A        Assert.assertArrayEquals(actual, EXPECTED_STATEMENTS);%0A    %7D%0A%0A    private SQLFile givenSQLFileParsedFromString(String sql) throws IOException %7B%0A        SQLFile file = new SQLFile();%0A        file.parse(new StringReader(sql));%0A        return file;%0A    %7D%0A%0A    private String%5B%5D getStatementsFromFile(SQLFile file) %7B%0A        List%3CString%3E statements = file.getStatements();%0A        return statements.toArray(new String%5Bstatements.size()%5D);%0A    %7D%0A%7D%0A

Test SQLFile with all the possible (handled) use cases