File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
TestRunner/app/tests/Marshalling Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,27 @@ describe(module.id, function () {
17
17
var str = NSString . alloc ( ) . initWithString ( 'hello hello' ) ;
18
18
expect ( str . isKindOfClass ( NSString ) ) . toBe ( true ) ;
19
19
} ) ;
20
+
21
+ it ( "Marshals NSString with null character" , function ( ) {
22
+ var JSObject = NSObject . extend ( {
23
+ 'x' : function ( ) {
24
+ return this . _x ;
25
+ } , 'setX:' : function ( x ) {
26
+ this . _x = x ;
27
+ }
28
+ } , {
29
+ exposedMethods : {
30
+ x : { returns : NSString } ,
31
+ 'setX:' : { returns : interop . types . void , params : [ NSString ] }
32
+ }
33
+ } ) ;
34
+
35
+ const data = 'null coming up: ' + String . fromCharCode ( 0 ) + ' and extra' ;
36
+
37
+ var instance = JSObject . alloc ( ) . init ( ) ;
38
+ instance . setValueForKey ( data , 'x' ) ;
39
+ expect ( instance . valueForKey ( 'x' ) ) . toBe ( data ) ;
40
+ } ) ;
20
41
21
42
it ( "String" , function ( ) {
22
43
var str = NSString . string ( ) ;
You can’t perform that action at this time.
0 commit comments