@@ -251,6 +251,17 @@ fn given_order_selectors_when_splitting_unit_tests_then_tests_and_resources_sepa
251251 true ,
252252 ) ) ,
253253 } ,
254+ UnitTestSplitTestCase {
255+ description : "a command that runs no unit tests rejects a bare test name" ,
256+ select : texts ( & [ "order_status" ] ) ,
257+ exclude : Vec :: new ( ) ,
258+ accepts_unit_tests : false ,
259+ expected_split : Err ( failure (
260+ "S013" ,
261+ "selector 'order_status' selects a unit test; only `sqb test` and `sqb build` accept unit-test selectors" ,
262+ None ,
263+ ) ) ,
264+ } ,
254265 UnitTestSplitTestCase {
255266 description : "a command that runs no unit tests rejects test: selectors" ,
256267 select : texts ( & [ "orders test:customer_status" ] ) ,
@@ -262,6 +273,17 @@ fn given_order_selectors_when_splitting_unit_tests_then_tests_and_resources_sepa
262273 None ,
263274 ) ) ,
264275 } ,
276+ UnitTestSplitTestCase {
277+ description : "an unknown test: name suggests the nearest unit tests" ,
278+ select : texts ( & [ "test:order_stats" ] ) ,
279+ exclude : Vec :: new ( ) ,
280+ accepts_unit_tests : true ,
281+ expected_split : Err ( failure (
282+ "S007" ,
283+ "unknown unit test name 'order_stats'" ,
284+ Some ( "did you mean 'order_status'?" ) ,
285+ ) ) ,
286+ } ,
265287 UnitTestSplitTestCase {
266288 description : "an unknown bare name suggests the closest unit test" ,
267289 select : texts ( & [ "customer_stat" ] ) ,
@@ -273,6 +295,28 @@ fn given_order_selectors_when_splitting_unit_tests_then_tests_and_resources_sepa
273295 Some ( "did you mean 'customer_status'?" ) ,
274296 ) ) ,
275297 } ,
298+ UnitTestSplitTestCase {
299+ description : "graph expansion of a unit test is refused" ,
300+ select : texts ( & [ "+order_status" ] ) ,
301+ exclude : Vec :: new ( ) ,
302+ accepts_unit_tests : true ,
303+ expected_split : Err ( failure (
304+ "S013" ,
305+ "selector '+order_status' expands a unit test with '+'; unit tests have no lineage, so select them by name without '+'" ,
306+ None ,
307+ ) ) ,
308+ } ,
309+ UnitTestSplitTestCase {
310+ description : "intersecting a unit test is refused" ,
311+ select : texts ( & [ "order_status,tag:daily" ] ) ,
312+ exclude : Vec :: new ( ) ,
313+ accepts_unit_tests : true ,
314+ expected_split : Err ( failure (
315+ "S013" ,
316+ "selector 'order_status,tag:daily' intersects a unit test with ','; unit tests can only be selected whole, by name" ,
317+ None ,
318+ ) ) ,
319+ } ,
276320 UnitTestSplitTestCase {
277321 description : "a stray trailing comma after a unit test reports the empty selector" ,
278322 select : texts ( & [ "test:order_status," ] ) ,
0 commit comments