From faabeffe8ad8e7f60aada368d5b73f8e836c155f Mon Sep 17 00:00:00 2001 From: hayden Date: Mon, 10 Jul 2023 10:21:16 +0800 Subject: [PATCH] test: hivesql abort syntax unit tests --- test/parser/hive/syntax/abortStatement.test.ts | 16 ++++++++++++++++ test/parser/hive/syntax/fixtures/abort.sql | 1 + 2 files changed, 17 insertions(+) create mode 100644 test/parser/hive/syntax/abortStatement.test.ts create mode 100644 test/parser/hive/syntax/fixtures/abort.sql diff --git a/test/parser/hive/syntax/abortStatement.test.ts b/test/parser/hive/syntax/abortStatement.test.ts new file mode 100644 index 0000000..1f2673d --- /dev/null +++ b/test/parser/hive/syntax/abortStatement.test.ts @@ -0,0 +1,16 @@ +import HiveSQL from '../../../../src/parser/hive'; +import { readSQL } from '../../../helper'; + +const parser = new HiveSQL(); + +const features = { + aborts: readSQL(__dirname, 'abort.sql'), +}; + +describe('Hive Abort Syntax Tests', () => { + features.aborts.forEach((ab) => { + it(ab, () => { + expect(parser.validate(ab).length).toBe(0); + }); + }); +}); diff --git a/test/parser/hive/syntax/fixtures/abort.sql b/test/parser/hive/syntax/fixtures/abort.sql new file mode 100644 index 0000000..b6047e2 --- /dev/null +++ b/test/parser/hive/syntax/fixtures/abort.sql @@ -0,0 +1 @@ +ABORT TRANSACTIONS 0000007 0000008 0000010 0000015; \ No newline at end of file