Skip to content

Commit

Permalink
Add another test for comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Eman-Shaaban committed Feb 1, 2017
1 parent f126eff commit 748e47f
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,32 @@ class CreateTableParserTest extends FlatSpec with Matchers {
statement.primaryKey.isEmpty shouldBe true // Primary is defined inline instead
statement.options.isEmpty shouldBe true
}

it should "parse multi-fields create table with comments" in {
val statement = parseSchemaAs[CreateTable](
"""
/*
Test
multiline
comments
*/
CREATE TABLE test.users (
user_id text PRIMARY KEY, -- Singleline dash comment
user_name text static,
user_age int static,
user_weight float // Singleline slash comment
);
"""
)
statement.ifNotExists shouldBe false
statement.columns shouldBe Seq(
Table.Column("user_id", DataType.Text, false, true),
Table.Column("user_name", DataType.Text, true, false),
Table.Column("user_age", DataType.Int, true, false),
Table.Column("user_weight", DataType.Float, false, false)
)
statement.primaryKey.isEmpty shouldBe true // Primary is defined inline instead
statement.options.isEmpty shouldBe true
}
}

0 comments on commit 748e47f

Please sign in to comment.