@@ -10,6 +10,7 @@ describe('KeychainAccess', function(){
10
10
var asciiPW = "test" ;
11
11
var mixedPW = "∆elta" ;
12
12
var unicodePW = "∆˚ˆ©ƒ®∂çµ˚¬˙ƒ®†¥" ;
13
+ var asciiComplexPW = "password: 0x4e6573746564" ;
13
14
var keychainName = "test.keychain" ;
14
15
15
16
it ( 'should be running on a mac' , function ( ) {
@@ -79,6 +80,16 @@ describe('KeychainAccess', function(){
79
80
} ) ;
80
81
} ) ;
81
82
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
+
82
93
describe ( 'when sent { account: "mixedAccount", password: "' + mixedPW + '", service: "' + testService + '" }' , function ( ) {
83
94
it ( 'should return "' + mixedPW , function ( done ) {
84
95
keychain . setPassword ( { account : "mixedAccount" , password : mixedPW , service : testService } , function ( err , pass ) {
@@ -162,6 +173,17 @@ describe('KeychainAccess', function(){
162
173
} ) ;
163
174
} ) ;
164
175
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
+
165
187
describe ( 'when sent { account: "mixedAccount", service: "' + testService + '" }' , function ( ) {
166
188
it ( 'should return ' + mixedPW , function ( done ) {
167
189
keychain . getPassword ( { account : "mixedAccount" , service : testService } , function ( err , pass ) {
0 commit comments