Skip to content

Commit

Permalink
🔍 test: Fix t.throws calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Apr 28, 2020
1 parent 4ef868e commit 51063f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions test/src/defaultdict.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ test( defaultdict.name , t => {

d.clear( ) ;

t.throws( d.get.bind( d , "x" ) , KeyError , "get raises" ) ;
t.throws( d.get.bind( d , "x" ) , { instanceOf: KeyError } , "get raises" ) ;

t.throws( d.delete.bind( d , "x" ) , KeyError , "delete raises" ) ;
t.throws( d.delete.bind( d , "x" ) , { instanceOf: KeyError } , "delete raises" ) ;

t.throws( d.popitem.bind( d ) , KeyError , "popitem raises" ) ;
t.throws( d.popitem.bind( d ) , { instanceOf: KeyError } , "popitem raises" ) ;

t.throws( d.pop.bind( d , "x" ) , KeyError , "pop raises" ) ;
t.throws( d.pop.bind( d , "x" ) , { instanceOf: KeyError } , "pop raises" ) ;

t.deepEqual( defaultdict.fromkeys( "abc" , -1 , default_factory ).get( "b" ) , -1 , "fromkeys default -1" ) ;

Expand Down
8 changes: 4 additions & 4 deletions test/src/dict.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ test( 'dict behaviour' , t => {

d.clear( ) ;

t.throws( d.get.bind( d , "x" ) , KeyError , "get raises" ) ;
t.throws( d.get.bind( d , "x" ) , { instanceOf: KeyError } , "get raises" ) ;

t.throws( d.delete.bind( d , "x" ) , KeyError , "delete raises" ) ;
t.throws( d.delete.bind( d , "x" ) , { instanceOf: KeyError } , "delete raises" ) ;

t.throws( d.popitem.bind( d ) , KeyError , "popitem raises" ) ;
t.throws( d.popitem.bind( d ) , { instanceOf: KeyError } , "popitem raises" ) ;

t.throws( d.pop.bind( d , "x" ) , KeyError , "pop raises" ) ;
t.throws( d.pop.bind( d , "x" ) , { instanceOf: KeyError } , "pop raises" ) ;

t.deepEqual( dict.fromkeys( "abc" , -1 ).get( "b" ) , -1 , "fromkeys default -1" ) ;

Expand Down

0 comments on commit 51063f1

Please sign in to comment.