@@ -10,6 +10,7 @@ describe('KeychainAccess', function(){
1010 var asciiPW = "test" ;
1111 var mixedPW = "∆elta" ;
1212 var unicodePW = "∆˚ˆ©ƒ®∂çµ˚¬˙ƒ®†¥" ;
13+ var asciiComplexPW = "password: 0x4e6573746564" ;
1314 var keychainName = "test.keychain" ;
1415
1516 it ( 'should be running on a mac' , function ( ) {
@@ -79,6 +80,16 @@ describe('KeychainAccess', function(){
7980 } ) ;
8081 } ) ;
8182
83+ describe ( 'when sent { account: "complexAccount", password: "' + asciiComplexPW + '", service: "' + testService + '" }' , function ( ) {
84+ it ( 'should return "' + asciiComplexPW , function ( done ) {
85+ keychain . setPassword ( { account : "complexAccount" , password : asciiComplexPW , service : testService } , function ( err , pass ) {
86+ if ( err ) throw err ;
87+ pass . should . equal ( asciiComplexPW ) ;
88+ done ( ) ;
89+ } ) ;
90+ } ) ;
91+ } ) ;
92+
8293 describe ( 'when sent { account: "mixedAccount", password: "' + mixedPW + '", service: "' + testService + '" }' , function ( ) {
8394 it ( 'should return "' + mixedPW , function ( done ) {
8495 keychain . setPassword ( { account : "mixedAccount" , password : mixedPW , service : testService } , function ( err , pass ) {
@@ -162,6 +173,17 @@ describe('KeychainAccess', function(){
162173 } ) ;
163174 } ) ;
164175
176+ describe ( 'when sent { account: "complexAccount", service: "' + testService + '" }' , function ( ) {
177+ it ( 'should return ' + asciiComplexPW , function ( done ) {
178+ keychain . getPassword ( { account : "complexAccount" , service : testService } , function ( err , pass ) {
179+ if ( err ) throw err ;
180+
181+ pass . should . equal ( asciiComplexPW ) ;
182+ done ( ) ;
183+ } ) ;
184+ } ) ;
185+ } ) ;
186+
165187 describe ( 'when sent { account: "mixedAccount", service: "' + testService + '" }' , function ( ) {
166188 it ( 'should return ' + mixedPW , function ( done ) {
167189 keychain . getPassword ( { account : "mixedAccount" , service : testService } , function ( err , pass ) {
0 commit comments