diff --git a/test/corpus/watcom/metadata-inline-header-boundary.expected.sql b/test/corpus/watcom/metadata-inline-header-boundary.expected.sql new file mode 100644 index 0000000..ba44f9b --- /dev/null +++ b/test/corpus/watcom/metadata-inline-header-boundary.expected.sql @@ -0,0 +1,15 @@ +CREATE PROCEDURE "fct"."metadata_boundary"() +-- METADATA +-- Description : Keeps CREATE PROCEDURE text in metadata comments untouched. +-- Version : 1.0 +-- Author : Test Author +-- Updated By : Test Author +-- Created : 2026-06-10 +-- Updated : 2026-06-10 +-- History : +-- v1.0: Initial creation mentions SELECT FROM WHERE - 2026-06-10 Test Author +-- METADATA END +BEGIN + SELECT 'CREATE PROCEDURE dbo.fake_object() should stay literal' AS description; + -- CREATE FUNCTION dbo.fake_comment() should stay comment text +END; diff --git a/test/corpus/watcom/metadata-inline-header-boundary.input.sql b/test/corpus/watcom/metadata-inline-header-boundary.input.sql new file mode 100644 index 0000000..63a1c74 --- /dev/null +++ b/test/corpus/watcom/metadata-inline-header-boundary.input.sql @@ -0,0 +1,15 @@ +create procedure "fct"."metadata_boundary"() +-- METADATA +-- Description : Keeps CREATE PROCEDURE text in metadata comments untouched. +-- Version : 1.0 +-- Author : Test Author +-- Updated By : Test Author +-- Created : 2026-06-10 +-- Updated : 2026-06-10 +-- History : +-- v1.0: Initial creation mentions SELECT FROM WHERE - 2026-06-10 Test Author +-- METADATA END +begin +select 'CREATE PROCEDURE dbo.fake_object() should stay literal' as description; +-- CREATE FUNCTION dbo.fake_comment() should stay comment text +end; diff --git a/test/corpus/watcom/metadata-multiple-headers-boundary.expected.sql b/test/corpus/watcom/metadata-multiple-headers-boundary.expected.sql new file mode 100644 index 0000000..8790f45 --- /dev/null +++ b/test/corpus/watcom/metadata-multiple-headers-boundary.expected.sql @@ -0,0 +1,30 @@ +-- CREATE PROCEDURE dbo.comment_decoy() should not affect metadata boundaries +CREATE PROCEDURE dbo.first_metadata_boundary() +-- METADATA +-- Description : First object header mentions CREATE FUNCTION as prose. +-- Version : 1.0 +-- Author : First Author +-- Updated By : First Author +-- Created : 2026-06-10 +-- Updated : 2026-06-10 +-- History : +-- v1.0: Created before the second metadata header - 2026-06-10 First Author +-- METADATA END +BEGIN + SELECT 1; +END; + +CREATE FUNCTION dbo.second_metadata_boundary() RETURNS integer +-- METADATA +-- Description : Second object header mentions CREATE TRIGGER as prose. +-- Version : 1.0 +-- Author : Second Author +-- Updated By : Second Author +-- Created : 2026-06-10 +-- Updated : 2026-06-10 +-- History : +-- v1.0: Created after the first metadata header - 2026-06-10 Second Author +-- METADATA END +BEGIN + RETURN 2; +END; diff --git a/test/corpus/watcom/metadata-multiple-headers-boundary.input.sql b/test/corpus/watcom/metadata-multiple-headers-boundary.input.sql new file mode 100644 index 0000000..0e2ff0d --- /dev/null +++ b/test/corpus/watcom/metadata-multiple-headers-boundary.input.sql @@ -0,0 +1,30 @@ +-- CREATE PROCEDURE dbo.comment_decoy() should not affect metadata boundaries +create procedure dbo.first_metadata_boundary() +-- METADATA +-- Description : First object header mentions CREATE FUNCTION as prose. +-- Version : 1.0 +-- Author : First Author +-- Updated By : First Author +-- Created : 2026-06-10 +-- Updated : 2026-06-10 +-- History : +-- v1.0: Created before the second metadata header - 2026-06-10 First Author +-- METADATA END +begin +select 1; +end; + +create function dbo.second_metadata_boundary() returns integer +-- METADATA +-- Description : Second object header mentions CREATE TRIGGER as prose. +-- Version : 1.0 +-- Author : Second Author +-- Updated By : Second Author +-- Created : 2026-06-10 +-- Updated : 2026-06-10 +-- History : +-- v1.0: Created after the first metadata header - 2026-06-10 Second Author +-- METADATA END +begin +return 2; +end;