Skip to content

Commit bdf5d17

Browse files
authored
Move impl cycle tests to min-prelude (#5108)
Use the facet_types min-prelude instead of defining a Core package in the test file.
1 parent 82fe19e commit bdf5d17

File tree

1 file changed

+4
-38
lines changed

1 file changed

+4
-38
lines changed

toolchain/check/testdata/impl/no_prelude/impl_cycle.carbon renamed to toolchain/check/testdata/impl/lookup/min_prelude/impl_cycle.carbon

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,18 @@
22
// Exceptions. See /LICENSE for license information.
33
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
44
//
5-
// EXTRA-ARGS: --no-dump-sem-ir
5+
// INCLUDE-FILE: toolchain/testing/min_prelude/facet_types.carbon
6+
// EXTRA-ARGS: --no-dump-sem-ir --custom-core
67
//
78
// AUTOUPDATE
89
// TIP: To test this file alone, run:
9-
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/impl_cycle.carbon
10+
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/lookup/min_prelude/impl_cycle.carbon
1011
// TIP: To dump output, run:
11-
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/impl_cycle.carbon
12-
13-
// --- core.carbon
14-
package Core;
15-
16-
interface As(Dest:! type) {
17-
fn Convert[self: Self]() -> Dest;
18-
}
19-
20-
interface ImplicitAs(Dest:! type) {
21-
fn Convert[self: Self]() -> Dest;
22-
}
23-
24-
interface BitAnd {
25-
fn Op[self: Self](other: Self) -> Self;
26-
}
27-
28-
impl forall [T:! type] T as BitAnd {
29-
fn Op[self: Self](other: Self) -> Self = "type.and";
30-
}
12+
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/lookup/min_prelude/impl_cycle.carbon
3113

3214
// --- fail_impl_simple_cycle.carbon
3315
library "[[@TEST_NAME]]";
3416

35-
import Core;
36-
3717
interface Z {}
3818

3919
// This creates a dependency cycle with itself.
@@ -57,8 +37,6 @@ fn F() {
5737
// --- todo_fail_impl_simple_where_cycle.carbon
5838
library "[[@TEST_NAME]]";
5939

60-
import Core;
61-
6240
interface Z {}
6341

6442
// This creates a dependency cycle with itself.
@@ -76,8 +54,6 @@ fn F() {
7654
// --- fail_impl_simple_two_interfaces.carbon
7755
library "[[@TEST_NAME]]";
7856

79-
import Core;
80-
8157
interface Z {}
8258
interface Y {}
8359

@@ -103,8 +79,6 @@ fn F() {
10379
// --- fail_impl_long_cycle.carbon
10480
library "[[@TEST_NAME]]";
10581

106-
import Core;
107-
10882
interface X {}
10983
interface Y {}
11084
interface Z {}
@@ -137,8 +111,6 @@ fn F() {
137111
// --- fail_impl_cycle_one_generic_param.carbon
138112
library "[[@TEST_NAME]]";
139113

140-
import Core;
141-
142114
interface ComparableWith(T:! type) {}
143115

144116
// This creates a dependency cycle with itself.
@@ -208,8 +180,6 @@ fn F() {
208180
// --- impl_recurse_with_simpler_type_no_cycle.carbon
209181
library "[[@TEST_NAME]]";
210182

211-
import Core;
212-
213183
class Wraps(T:! type) {}
214184

215185
interface Printable {}
@@ -228,8 +198,6 @@ fn F() {
228198
// --- impl_recurse_with_simpler_type_in_generic_param_no_cycle.carbon
229199
library "[[@TEST_NAME]]";
230200

231-
import Core;
232-
233201
class Wraps(T:! type) {}
234202

235203
interface ComparableTo(T:! type) {}
@@ -253,8 +221,6 @@ fn F() {
253221
// --- impl_recurse_with_simpler_type_in_generic_param_bidirectional_no_cycle.carbon
254222
library "[[@TEST_NAME]]";
255223

256-
import Core;
257-
258224
// Implement this for a type in one direction.
259225
interface ComparableTo(T:! type) {}
260226
// Use this as a bound with two types in any direction.

0 commit comments

Comments
 (0)