You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/tests/directives.md
+13-5Lines changed: 13 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -264,13 +264,21 @@ Consider writing the test as a proper incremental test instead.
264
264
265
265
#### The edition directive
266
266
267
-
The `//@ edition` directive can take an exact edition, a bounded half-open range of editions or a left-bounded half-open range of editions, this affects which edition is used by `./x test` to run the test. For example:
267
+
The `//@ edition` directive can take an exact edition, a bounded range of editions,
268
+
or a left-bounded half-open range of editions.
269
+
This affects which edition is used by `./x test` to run the test.
268
270
269
-
- A test with the `//@ edition: 2018` directive will only run under the 2018 edition.
270
-
- A test with the `//@ edition: 2015..2021` directive can be run under both the 2015 and 2018 editions. However, CI will only run the test with the lowest edition possible (2015 in this case).
271
-
- A test with the `//@ edition: 2018..` directive will run under any edition greater or equal than 2018. However, CI will only run the test with the lowest edition possible (2018 in this case).
271
+
For example:
272
272
273
-
You can also force `./x test` to use a specific edition by passing the `-- --edition=` argument. However, tests with the `//@ edition` directive will clamp the value passed to the argument. For example, if we run `./x test -- --edition=2015`:
273
+
- A test with the `//@ edition: 2018` directive will only run under the 2018 edition.
274
+
- A test with the `//@ edition: 2015..2021` directive can be run under the 2015, 2018, and 2021 editions.
275
+
However, CI will only run the test with the lowest edition in the range (which is 2015 in this example).
276
+
- A test with the `//@ edition: 2018..` directive will run under 2018 edition or greater.
277
+
However, CI will only run the test with the lowest edition in the range (which is 2018 in this example).
278
+
279
+
You can also force `./x test` to use a specific edition by passing the `-- --edition=` argument.
280
+
However, tests with the `//@ edition` directive will clamp the value passed to the argument.
281
+
For example, if we run `./x test -- --edition=2015`:
274
282
275
283
- A test with the `//@ edition: 2018` will run with the 2018 edition.
276
284
- A test with the `//@ edition: 2015..2021` will be run with the 2015 edition.
0 commit comments