Skip to content

Commit 0dd025e

Browse files
authored
Add illegal version tests to SupportedVersionTest (#3239)
This resolves #3238 Adding a few tests that include illegal version clauses to the end-to-end YAML SupportedVersionTest
1 parent 376d6d8 commit 0dd025e

File tree

4 files changed

+97
-1
lines changed

4 files changed

+97
-1
lines changed

yaml-tests/src/test/java/SupportedVersionTest.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ static Stream<String> shouldFail() {
8585
"lower-at-block",
8686
"lower-at-query",
8787
"late-query-supported-version",
88-
"late-file-options"
88+
"late-file-options",
89+
"illegal-version-at-file",
90+
"illegal-version-at-block",
91+
"illegal-version-at-query"
8992
);
9093
}
9194

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#
2+
# illegal-version-at-block.yamsql
3+
#
4+
# This source file is part of the FoundationDB open source project
5+
#
6+
# Copyright 2021-2025 Apple Inc. and the FoundationDB project authors
7+
#
8+
# Licensed under the Apache License, Version 2.0 (the "License");
9+
# you may not use this file except in compliance with the License.
10+
# You may obtain a copy of the License at
11+
#
12+
# http://www.apache.org/licenses/LICENSE-2.0
13+
#
14+
# Unless required by applicable law or agreed to in writing, software
15+
# distributed under the License is distributed on an "AS IS" BASIS,
16+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
# See the License for the specific language governing permissions and
18+
# limitations under the License.
19+
20+
# This test should fail
21+
---
22+
schema_template:
23+
create table t1(id bigint, col1 bigint, primary key(id))
24+
---
25+
test_block:
26+
options:
27+
supported_version: illegal-version
28+
tests:
29+
-
30+
- query: SELECT * FROM t1;
31+
- result: []
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#
2+
# illegal-version-at-file.yamsql
3+
#
4+
# This source file is part of the FoundationDB open source project
5+
#
6+
# Copyright 2021-2025 Apple Inc. and the FoundationDB project authors
7+
#
8+
# Licensed under the Apache License, Version 2.0 (the "License");
9+
# you may not use this file except in compliance with the License.
10+
# You may obtain a copy of the License at
11+
#
12+
# http://www.apache.org/licenses/LICENSE-2.0
13+
#
14+
# Unless required by applicable law or agreed to in writing, software
15+
# distributed under the License is distributed on an "AS IS" BASIS,
16+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
# See the License for the specific language governing permissions and
18+
# limitations under the License.
19+
20+
# This test should fail
21+
---
22+
options:
23+
supported_version: illegal_version
24+
---
25+
schema_template:
26+
create table t1(id bigint, col1 bigint, primary key(id))
27+
---
28+
test_block:
29+
tests:
30+
-
31+
- query: SELECT * FROM t1;
32+
- result: []
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#
2+
# illegal-version-at-query.yamsql
3+
#
4+
# This source file is part of the FoundationDB open source project
5+
#
6+
# Copyright 2021-2025 Apple Inc. and the FoundationDB project authors
7+
#
8+
# Licensed under the Apache License, Version 2.0 (the "License");
9+
# you may not use this file except in compliance with the License.
10+
# You may obtain a copy of the License at
11+
#
12+
# http://www.apache.org/licenses/LICENSE-2.0
13+
#
14+
# Unless required by applicable law or agreed to in writing, software
15+
# distributed under the License is distributed on an "AS IS" BASIS,
16+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
# See the License for the specific language governing permissions and
18+
# limitations under the License.
19+
20+
# This test should fail
21+
---
22+
schema_template:
23+
create table t1(id bigint, col1 bigint, primary key(id))
24+
---
25+
test_block:
26+
tests:
27+
-
28+
- query: SELECT * FROM t1;
29+
- supported_version: illegal_version
30+
- result: []

0 commit comments

Comments
 (0)