@@ -24,28 +24,28 @@ test( deque.name , t => {
2424
2525let d = new Deque ( ) ;
2626
27- t . throws ( d . values . bind ( d ) , NotImplementedError , "Deque values" ) ;
28- t . throws ( l . bind ( null , d ) , NotImplementedError , "list( Deque )" ) ;
29- t . throws ( d . len . bind ( d ) , NotImplementedError , "Deque len" ) ;
30- t . throws ( d . capacity . bind ( d ) , NotImplementedError , "Deque capacity" ) ;
31- t . throws ( d . empty . bind ( d ) , NotImplementedError , "Deque empty" ) ;
32- t . throws ( d . append . bind ( d , 0 ) , NotImplementedError , "Deque append" ) ;
33- t . throws ( d . appendleft . bind ( d , 0 ) , NotImplementedError , "Deque appendleft" ) ;
34- t . throws ( d . clear . bind ( d ) , NotImplementedError , "Deque clear" ) ;
35- t . throws ( d . copy . bind ( d ) , NotImplementedError , "Deque copy" ) ;
36- t . throws ( d . count . bind ( d , 0 ) , NotImplementedError , "Deque count" ) ;
37- t . throws ( d . extend . bind ( d , "a" ) , NotImplementedError , "Deque extend" ) ;
38- t . throws ( d . extendleft . bind ( d , "a" ) , NotImplementedError , "Deque extendleft" ) ;
39- t . throws ( d . _where . bind ( d , 0 ) , NotImplementedError , "Deque _where" ) ;
40- t . throws ( d . get . bind ( d , 0 ) , NotImplementedError , "Deque get" ) ;
41- t . throws ( d . set . bind ( d , 0 , 0 ) , NotImplementedError , "Deque set" ) ;
42- t . throws ( d . insert . bind ( d , 0 , 0 ) , NotImplementedError , "Deque insert" ) ;
43- t . throws ( d . pop . bind ( d ) , NotImplementedError , "Deque pop" ) ;
44- t . throws ( d . popleft . bind ( d ) , NotImplementedError , "Deque popleft" ) ;
45-
46- t . throws ( deque . bind ( null , null , 1.2 ) , TypeError , "maxlen float" ) ;
47- t . throws ( deque . bind ( null , null , - 1 ) , ValueError , "maxlen negative" ) ;
48- t . throws ( deque . bind ( null , null , { } ) , TypeError , "maxlen object" ) ;
27+ t . throws ( d . values . bind ( d ) , { instanceOf : NotImplementedError } , "Deque values" ) ;
28+ t . throws ( l . bind ( null , d ) , { instanceOf : NotImplementedError } , "list( Deque )" ) ;
29+ t . throws ( d . len . bind ( d ) , { instanceOf : NotImplementedError } , "Deque len" ) ;
30+ t . throws ( d . capacity . bind ( d ) , { instanceOf : NotImplementedError } , "Deque capacity" ) ;
31+ t . throws ( d . empty . bind ( d ) , { instanceOf : NotImplementedError } , "Deque empty" ) ;
32+ t . throws ( d . append . bind ( d , 0 ) , { instanceOf : NotImplementedError } , "Deque append" ) ;
33+ t . throws ( d . appendleft . bind ( d , 0 ) , { instanceOf : NotImplementedError } , "Deque appendleft" ) ;
34+ t . throws ( d . clear . bind ( d ) , { instanceOf : NotImplementedError } , "Deque clear" ) ;
35+ t . throws ( d . copy . bind ( d ) , { instanceOf : NotImplementedError } , "Deque copy" ) ;
36+ t . throws ( d . count . bind ( d , 0 ) , { instanceOf : NotImplementedError } , "Deque count" ) ;
37+ t . throws ( d . extend . bind ( d , "a" ) , { instanceOf : NotImplementedError } , "Deque extend" ) ;
38+ t . throws ( d . extendleft . bind ( d , "a" ) , { instanceOf : NotImplementedError } , "Deque extendleft" ) ;
39+ t . throws ( d . _where . bind ( d , 0 ) , { instanceOf : NotImplementedError } , "Deque _where" ) ;
40+ t . throws ( d . get . bind ( d , 0 ) , { instanceOf : NotImplementedError } , "Deque get" ) ;
41+ t . throws ( d . set . bind ( d , 0 , 0 ) , { instanceOf : NotImplementedError } , "Deque set" ) ;
42+ t . throws ( d . insert . bind ( d , 0 , 0 ) , { instanceOf : NotImplementedError } , "Deque insert" ) ;
43+ t . throws ( d . pop . bind ( d ) , { instanceOf : NotImplementedError } , "Deque pop" ) ;
44+ t . throws ( d . popleft . bind ( d ) , { instanceOf : NotImplementedError } , "Deque popleft" ) ;
45+
46+ t . throws ( deque . bind ( null , null , 1.2 ) , { instanceOf : TypeError } , "maxlen float" ) ;
47+ t . throws ( deque . bind ( null , null , - 1 ) , { instanceOf : ValueError } , "maxlen negative" ) ;
48+ t . throws ( deque . bind ( null , null , { } ) , { instanceOf : TypeError } , "maxlen object" ) ;
4949
5050t . true ( deque ( ) . empty ( ) , "empty" ) ;
5151t . true ( ! deque ( "abc" ) . empty ( ) , "not empty" ) ;
@@ -86,9 +86,9 @@ test( deque.name , t => {
8686t . true ( d . copy ( ) !== d , "empty copy is different" ) ;
8787t . deepEqual ( d . clear ( ) , d , "empty clear" ) ;
8888
89- t . throws ( d . append ( "a" ) . get . bind ( d , 0 ) , IndexError , "empty get" ) ;
90- t . throws ( d . append ( "a" ) . set . bind ( d , 0 , "b" ) , IndexError , "empty set" ) ;
91- t . throws ( d . append ( "a" ) . pop . bind ( d ) , IndexError , "empty pop" ) ;
89+ t . throws ( d . append ( "a" ) . get . bind ( d , 0 ) , { instanceOf : IndexError } , "empty get" ) ;
90+ t . throws ( d . append ( "a" ) . set . bind ( d , 0 , "b" ) , { instanceOf : IndexError } , "empty set" ) ;
91+ t . throws ( d . append ( "a" ) . pop . bind ( d ) , { instanceOf : IndexError } , "empty pop" ) ;
9292
9393d = deque ( "abc" , 1 ) ;
9494
@@ -98,12 +98,12 @@ test( deque.name , t => {
9898t . deepEqual ( d . clear ( ) , d , "single clear" ) ;
9999t . deepEqual ( d . clear ( ) . len ( ) , 0 , "single clear len" ) ;
100100
101- t . throws ( d . append ( "a" ) . get . bind ( d , 1 ) , IndexError , "single get 1" ) ;
102- t . throws ( d . append ( "a" ) . set . bind ( d , 1 , "b" ) , IndexError , "single set 1" ) ;
103- t . throws ( d . clear ( ) . pop . bind ( d ) , IndexError , "single pop clear" ) ;
101+ t . throws ( d . append ( "a" ) . get . bind ( d , 1 ) , { instanceOf : IndexError } , "single get 1" ) ;
102+ t . throws ( d . append ( "a" ) . set . bind ( d , 1 , "b" ) , { instanceOf : IndexError } , "single set 1" ) ;
103+ t . throws ( d . clear ( ) . pop . bind ( d ) , { instanceOf : IndexError } , "single pop clear" ) ;
104104
105- t . throws ( d . clear ( ) . get . bind ( d , 0 ) , IndexError , "single empty get 0" ) ;
106- t . throws ( d . clear ( ) . set . bind ( d , 0 , "b" ) , IndexError , "single empty set 0" ) ;
105+ t . throws ( d . clear ( ) . get . bind ( d , 0 ) , { instanceOf : IndexError } , "single empty get 0" ) ;
106+ t . throws ( d . clear ( ) . set . bind ( d , 0 , "b" ) , { instanceOf : IndexError } , "single empty set 0" ) ;
107107
108108d . extend ( "abcdef" ) ;
109109
@@ -221,11 +221,11 @@ test( deque.name , t => {
221221t . deepEqual ( deque ( "abc" ) . index ( "b" ) , 1 , "index abc" ) ;
222222t . deepEqual ( deque ( "abcb" ) . index ( "b" ) , 1 , "index abcb" ) ;
223223t . deepEqual ( deque ( "abcb" ) . index ( "b" , 2 ) , 3 , "index abcb 2" ) ;
224- t . throws ( d . clear ( ) . extend ( "abc" ) . index . bind ( d , "d" ) , ValueError , "index raises" ) ;
225- t . throws ( d . clear ( ) . extend ( "abc" ) . index . bind ( d , "b" , 2 , 3 ) , ValueError , "index raises range" ) ;
224+ t . throws ( d . clear ( ) . extend ( "abc" ) . index . bind ( d , "d" ) , { instanceOf : ValueError } , "index raises" ) ;
225+ t . throws ( d . clear ( ) . extend ( "abc" ) . index . bind ( d , "b" , 2 , 3 ) , { instanceOf : ValueError } , "index raises range" ) ;
226226
227- t . throws ( d . clear ( ) . extend ( "abc" ) . get . bind ( d , - 1 ) , IndexError , "get -1" ) ;
228- t . throws ( d . clear ( ) . extend ( "abc" ) . get . bind ( d , 4 ) , IndexError , "get out of bounds" ) ;
227+ t . throws ( d . clear ( ) . extend ( "abc" ) . get . bind ( d , - 1 ) , { instanceOf : IndexError } , "get -1" ) ;
228+ t . throws ( d . clear ( ) . extend ( "abc" ) . get . bind ( d , 4 ) , { instanceOf : IndexError } , "get out of bounds" ) ;
229229
230230t . deepEqual ( l ( deque ( "abcde" ) . rotate ( 2 ) ) , l ( "deabc" ) , "rotate 2" ) ;
231231t . deepEqual ( l ( deque ( "abcde" ) . rotate ( 0 ) ) , l ( "abcde" ) , "rotate 0" ) ;
0 commit comments