@@ -285,7 +285,8 @@ exports['Tasks'] = {
285285 }
286286 } ) ;
287287 task . run ( 'a:b:c' ) . start ( ) ;
288- } , 'Task#clearQueue' : function ( test ) {
288+ } ,
289+ 'Task#clearQueue' : function ( test ) {
289290 test . expect ( 1 ) ;
290291 var task = this . task ;
291292 task . registerTask ( 'a' , 'Push task name onto result.' , result . pushTaskname ) ;
@@ -305,6 +306,59 @@ exports['Tasks'] = {
305306 } ) ;
306307 task . run ( 'a b c d e' ) . start ( ) ;
307308 } ,
309+ 'Task#mark' : function ( test ) {
310+ // test.expect(1);
311+ var task = this . task ;
312+ task . registerTask ( 'a' , 'Explode.' , function ( ) {
313+ throw task . taskError ( 'whoops.' ) ;
314+ } ) ;
315+ task . registerTask ( 'b' , 'This task should never run.' , result . pushTaskname ) ;
316+ task . registerTask ( 'c' , 'This task should never run.' , result . pushTaskname ) ;
317+
318+ task . registerTask ( 'd' , 'Push task name onto result.' , result . pushTaskname ) ;
319+ task . registerTask ( 'e' , 'Explode.' , function ( ) {
320+ throw task . taskError ( 'whoops.' ) ;
321+ } ) ;
322+ task . registerTask ( 'f' , 'This task should never run.' , result . pushTaskname ) ;
323+
324+ task . registerTask ( 'g' , 'Push task name onto result.' , result . pushTaskname ) ;
325+ task . registerTask ( 'h' , 'Push task name onto result.' , result . pushTaskname ) ;
326+ task . registerTask ( 'i' , 'Explode.' , function ( ) {
327+ throw task . taskError ( 'whoops.' ) ;
328+ } ) ;
329+
330+ task . registerTask ( 'j' , 'Run a task and push task name onto result.' , function ( ) {
331+ task . run ( 'k' ) ;
332+ result . push ( this . name ) ;
333+ } ) ;
334+ task . registerTask ( 'k' , 'Explode.' , function ( ) {
335+ throw task . taskError ( 'whoops.' ) ;
336+ } ) ;
337+ task . registerTask ( 'l' , 'This task should never run.' , result . pushTaskname ) ;
338+
339+ task . registerTask ( 'm' , 'Push task name onto result.' , result . pushTaskname ) ;
340+ task . registerTask ( 'n' , 'Run a task and push task name onto result.' , function ( ) {
341+ task . run ( 'o' ) ;
342+ result . push ( this . name ) ;
343+ } ) ;
344+ task . registerTask ( 'o' , 'Explode.' , function ( ) {
345+ throw task . taskError ( 'whoops.' ) ;
346+ } ) ;
347+
348+ task . registerTask ( 'p' , 'Push task name onto result.' , result . pushTaskname ) ;
349+
350+ task . options ( {
351+ error : function ( e ) {
352+ result . push ( '!' + this . name ) ;
353+ task . clearQueue ( { untilMarker : true } ) ;
354+ } ,
355+ done : function ( ) {
356+ test . strictEqual ( result . getJoined ( ) , '!ad!egh!ij!kmn!op' , 'The specified tasks should have run, in-order.' ) ;
357+ test . done ( ) ;
358+ }
359+ } ) ;
360+ task . run ( 'a b c' ) . mark ( ) . run ( 'd e f' ) . mark ( ) . run ( 'g h i' ) . mark ( ) . run ( 'j l' ) . mark ( ) . run ( 'm n' ) . mark ( ) . run ( 'p' ) . mark ( ) . start ( ) ;
361+ } ,
308362 'Task#requires' : function ( test ) {
309363 test . expect ( 1 ) ;
310364 var task = this . task ;
0 commit comments