From 7eb0f50bae0debfd0ca4b2da27c92424ffb88a6d Mon Sep 17 00:00:00 2001 From: myyrakle Date: Wed, 31 Jul 2024 23:17:28 +0900 Subject: [PATCH] =?UTF-8?q?[#145]=20insert=5Fquery=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=EC=BC=80=EC=9D=B4=EC=8A=A4=20=EB=B3=B4=EC=99=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/parser/test/insert.rs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/parser/test/insert.rs b/src/parser/test/insert.rs index 4bfc049..17e6267 100644 --- a/src/parser/test/insert.rs +++ b/src/parser/test/insert.rs @@ -269,6 +269,12 @@ fn test_insert_query() { expected: Default::default(), want_error: true, }, + TestCase { + name: "실패: INSERT SELECT".into(), + input: vec![Token::Insert, Token::Select], + expected: Default::default(), + want_error: true, + }, TestCase { name: "실패: INSERT INTO foo.bar(".into(), input: vec![ @@ -282,6 +288,19 @@ fn test_insert_query() { expected: Default::default(), want_error: true, }, + TestCase { + name: "실패: INSERT INTO foo.bar)".into(), + input: vec![ + Token::Insert, + Token::Into, + Token::Identifier("foo".into()), + Token::Period, + Token::Identifier("bar".into()), + Token::RightParentheses, + ], + expected: Default::default(), + want_error: true, + }, TestCase { name: "실패: INSERT INTO foo.bar(a,b".into(), input: vec![ @@ -316,6 +335,23 @@ fn test_insert_query() { expected: Default::default(), want_error: true, }, + TestCase { + name: "실패: INSERT INTO foo.bar(a,b)".into(), + input: vec![ + Token::Insert, + Token::Into, + Token::Identifier("foo".into()), + Token::Period, + Token::Identifier("bar".into()), + Token::LeftParentheses, + Token::Identifier("a".into()), + Token::Comma, + Token::Identifier("b".into()), + Token::RightParentheses, + ], + expected: Default::default(), + want_error: true, + }, TestCase { name: "실패: INSERT INTO foo.bar(a, b, c) Values(1, 2), (4, 5)".into(), input: vec![