@@ -27,32 +27,32 @@ test( 'Deque base class' , t => {
2727
2828 const d = new Deque ( ) ;
2929
30- t . throws ( d . values . bind ( d ) , NotImplementedError , "Deque values" ) ;
31- t . throws ( l . bind ( null , d ) , NotImplementedError , "list( Deque )" ) ;
32- t . throws ( d . len . bind ( d ) , NotImplementedError , "Deque len" ) ;
33- t . throws ( d . capacity . bind ( d ) , NotImplementedError , "Deque capacity" ) ;
34- t . throws ( d . empty . bind ( d ) , NotImplementedError , "Deque empty" ) ;
35- t . throws ( d . append . bind ( d , 0 ) , NotImplementedError , "Deque append" ) ;
36- t . throws ( d . appendleft . bind ( d , 0 ) , NotImplementedError , "Deque appendleft" ) ;
37- t . throws ( d . clear . bind ( d ) , NotImplementedError , "Deque clear" ) ;
38- t . throws ( d . copy . bind ( d ) , NotImplementedError , "Deque copy" ) ;
39- t . throws ( d . count . bind ( d , 0 ) , NotImplementedError , "Deque count" ) ;
40- t . throws ( d . extend . bind ( d , "a" ) , NotImplementedError , "Deque extend" ) ;
41- t . throws ( d . extendleft . bind ( d , "a" ) , NotImplementedError , "Deque extendleft" ) ;
42- t . throws ( d . _where . bind ( d , 0 ) , NotImplementedError , "Deque _where" ) ;
43- t . throws ( d . get . bind ( d , 0 ) , NotImplementedError , "Deque get" ) ;
44- t . throws ( d . set . bind ( d , 0 , 0 ) , NotImplementedError , "Deque set" ) ;
45- t . throws ( d . insert . bind ( d , 0 , 0 ) , NotImplementedError , "Deque insert" ) ;
46- t . throws ( d . pop . bind ( d ) , NotImplementedError , "Deque pop" ) ;
47- t . throws ( d . popleft . bind ( d ) , NotImplementedError , "Deque popleft" ) ;
30+ t . throws ( d . values . bind ( d ) , { instanceOf : NotImplementedError } , "Deque values" ) ;
31+ t . throws ( l . bind ( null , d ) , { instanceOf : NotImplementedError } , "list( Deque )" ) ;
32+ t . throws ( d . len . bind ( d ) , { instanceOf : NotImplementedError } , "Deque len" ) ;
33+ t . throws ( d . capacity . bind ( d ) , { instanceOf : NotImplementedError } , "Deque capacity" ) ;
34+ t . throws ( d . empty . bind ( d ) , { instanceOf : NotImplementedError } , "Deque empty" ) ;
35+ t . throws ( d . append . bind ( d , 0 ) , { instanceOf : NotImplementedError } , "Deque append" ) ;
36+ t . throws ( d . appendleft . bind ( d , 0 ) , { instanceOf : NotImplementedError } , "Deque appendleft" ) ;
37+ t . throws ( d . clear . bind ( d ) , { instanceOf : NotImplementedError } , "Deque clear" ) ;
38+ t . throws ( d . copy . bind ( d ) , { instanceOf : NotImplementedError } , "Deque copy" ) ;
39+ t . throws ( d . count . bind ( d , 0 ) , { instanceOf : NotImplementedError } , "Deque count" ) ;
40+ t . throws ( d . extend . bind ( d , "a" ) , { instanceOf : NotImplementedError } , "Deque extend" ) ;
41+ t . throws ( d . extendleft . bind ( d , "a" ) , { instanceOf : NotImplementedError } , "Deque extendleft" ) ;
42+ t . throws ( d . _where . bind ( d , 0 ) , { instanceOf : NotImplementedError } , "Deque _where" ) ;
43+ t . throws ( d . get . bind ( d , 0 ) , { instanceOf : NotImplementedError } , "Deque get" ) ;
44+ t . throws ( d . set . bind ( d , 0 , 0 ) , { instanceOf : NotImplementedError } , "Deque set" ) ;
45+ t . throws ( d . insert . bind ( d , 0 , 0 ) , { instanceOf : NotImplementedError } , "Deque insert" ) ;
46+ t . throws ( d . pop . bind ( d ) , { instanceOf : NotImplementedError } , "Deque pop" ) ;
47+ t . throws ( d . popleft . bind ( d ) , { instanceOf : NotImplementedError } , "Deque popleft" ) ;
4848
4949} ) ;
5050
5151test ( 'deque throws' , t => {
5252
53- t . throws ( deque . bind ( null , null , 1.2 ) , TypeError , "maxlen float" ) ;
54- t . throws ( deque . bind ( null , null , - 1 ) , ValueError , "maxlen negative" ) ;
55- t . throws ( deque . bind ( null , null , { } ) , TypeError , "maxlen object" ) ;
53+ t . throws ( deque . bind ( null , null , 1.2 ) , { instanceOf : TypeError } , "maxlen float" ) ;
54+ t . throws ( deque . bind ( null , null , - 1 ) , { instanceOf : ValueError } , "maxlen negative" ) ;
55+ t . throws ( deque . bind ( null , null , { } ) , { instanceOf : TypeError } , "maxlen object" ) ;
5656
5757} ) ;
5858
@@ -121,9 +121,9 @@ test( 'EmptyDeque' , t => {
121121 t . true ( d . copy ( ) !== d , "empty copy is different" ) ;
122122 t . deepEqual ( d . clear ( ) , d , "empty clear" ) ;
123123
124- t . throws ( d . append ( "a" ) . get . bind ( d , 0 ) , IndexError , "empty get" ) ;
125- t . throws ( d . append ( "a" ) . set . bind ( d , 0 , "b" ) , IndexError , "empty set" ) ;
126- t . throws ( d . append ( "a" ) . pop . bind ( d ) , IndexError , "empty pop" ) ;
124+ t . throws ( d . append ( "a" ) . get . bind ( d , 0 ) , { instanceOf : IndexError } , "empty get" ) ;
125+ t . throws ( d . append ( "a" ) . set . bind ( d , 0 , "b" ) , { instanceOf : IndexError } , "empty set" ) ;
126+ t . throws ( d . append ( "a" ) . pop . bind ( d ) , { instanceOf : IndexError } , "empty pop" ) ;
127127
128128} ) ;
129129
@@ -137,12 +137,12 @@ test( 'SingleElementDeque' , t => {
137137 t . deepEqual ( d . clear ( ) , d , "single clear" ) ;
138138 t . deepEqual ( d . clear ( ) . len ( ) , 0 , "single clear len" ) ;
139139
140- t . throws ( d . append ( "a" ) . get . bind ( d , 1 ) , IndexError , "single get 1" ) ;
141- t . throws ( d . append ( "a" ) . set . bind ( d , 1 , "b" ) , IndexError , "single set 1" ) ;
142- t . throws ( d . clear ( ) . pop . bind ( d ) , IndexError , "single pop clear" ) ;
140+ t . throws ( d . append ( "a" ) . get . bind ( d , 1 ) , { instanceOf : IndexError } , "single get 1" ) ;
141+ t . throws ( d . append ( "a" ) . set . bind ( d , 1 , "b" ) , { instanceOf : IndexError } , "single set 1" ) ;
142+ t . throws ( d . clear ( ) . pop . bind ( d ) , { instanceOf : IndexError } , "single pop clear" ) ;
143143
144- t . throws ( d . clear ( ) . get . bind ( d , 0 ) , IndexError , "single empty get 0" ) ;
145- t . throws ( d . clear ( ) . set . bind ( d , 0 , "b" ) , IndexError , "single empty set 0" ) ;
144+ t . throws ( d . clear ( ) . get . bind ( d , 0 ) , { instanceOf : IndexError } , "single empty get 0" ) ;
145+ t . throws ( d . clear ( ) . set . bind ( d , 0 , "b" ) , { instanceOf : IndexError } , "single empty set 0" ) ;
146146
147147 d . extend ( "abcdef" ) ;
148148
@@ -282,11 +282,11 @@ test( 'miscellaneous' , t => {
282282 t . deepEqual ( deque ( "abc" ) . index ( "b" ) , 1 , "index abc" ) ;
283283 t . deepEqual ( deque ( "abcb" ) . index ( "b" ) , 1 , "index abcb" ) ;
284284 t . deepEqual ( deque ( "abcb" ) . index ( "b" , 2 ) , 3 , "index abcb 2" ) ;
285- t . throws ( d . clear ( ) . extend ( "abc" ) . index . bind ( d , "d" ) , ValueError , "index raises" ) ;
286- t . throws ( d . clear ( ) . extend ( "abc" ) . index . bind ( d , "b" , 2 , 3 ) , ValueError , "index raises range" ) ;
285+ t . throws ( d . clear ( ) . extend ( "abc" ) . index . bind ( d , "d" ) , { instanceOf : ValueError } , "index raises" ) ;
286+ t . throws ( d . clear ( ) . extend ( "abc" ) . index . bind ( d , "b" , 2 , 3 ) , { instanceOf : ValueError } , "index raises range" ) ;
287287
288- t . throws ( d . clear ( ) . extend ( "abc" ) . get . bind ( d , - 1 ) , IndexError , "get -1" ) ;
289- t . throws ( d . clear ( ) . extend ( "abc" ) . get . bind ( d , 4 ) , IndexError , "get out of bounds" ) ;
288+ t . throws ( d . clear ( ) . extend ( "abc" ) . get . bind ( d , - 1 ) , { instanceOf : IndexError } , "get -1" ) ;
289+ t . throws ( d . clear ( ) . extend ( "abc" ) . get . bind ( d , 4 ) , { instanceOf : IndexError } , "get out of bounds" ) ;
290290
291291 t . deepEqual ( l ( deque ( "abcde" ) . rotate ( 2 ) ) , l ( "deabc" ) , "rotate 2" ) ;
292292 t . deepEqual ( l ( deque ( "abcde" ) . rotate ( 0 ) ) , l ( "abcde" ) , "rotate 0" ) ;
0 commit comments