@@ -44,6 +44,7 @@ describe("resource", function() {
44
44
expect ( isValidDottedPath ( '1abc' ) ) . toBe ( false ) ;
45
45
expect ( isValidDottedPath ( '.' ) ) . toBe ( false ) ;
46
46
expect ( isValidDottedPath ( '$' ) ) . toBe ( true ) ;
47
+ expect ( isValidDottedPath ( '@' ) ) . toBe ( true ) ;
47
48
expect ( isValidDottedPath ( 'a' ) ) . toBe ( true ) ;
48
49
expect ( isValidDottedPath ( 'A' ) ) . toBe ( true ) ;
49
50
expect ( isValidDottedPath ( 'a1' ) ) . toBe ( true ) ;
@@ -53,12 +54,14 @@ describe("resource", function() {
53
54
expect ( isValidDottedPath ( '$.$' ) ) . toBe ( true ) ;
54
55
expect ( isValidDottedPath ( '.$' ) ) . toBe ( false ) ;
55
56
expect ( isValidDottedPath ( '$.' ) ) . toBe ( false ) ;
57
+ expect ( isValidDottedPath ( '@.' ) ) . toBe ( false ) ;
58
+ expect ( isValidDottedPath ( '.@' ) ) . toBe ( false ) ;
56
59
} ) ;
57
60
} ) ;
58
61
59
62
describe ( 'lookupDottedPath' , function ( ) {
60
63
/* global lookupDottedPath: false */
61
- var data = { a : { b : 'foo' , c : null } } ;
64
+ var data = { a : { b : 'foo' , c : null , '@d' : 'd-foo' } , '@b' : 'b-foo' } ;
62
65
63
66
it ( 'should throw for invalid path' , function ( ) {
64
67
expect ( function ( ) {
@@ -68,9 +71,11 @@ describe("resource", function() {
68
71
} ) ;
69
72
70
73
it ( 'should get dotted paths' , function ( ) {
71
- expect ( lookupDottedPath ( data , 'a' ) ) . toEqual ( { b : 'foo' , c : null } ) ;
74
+ expect ( lookupDottedPath ( data , 'a' ) ) . toEqual ( { b : 'foo' , c : null , '@d' : 'd-foo' } ) ;
72
75
expect ( lookupDottedPath ( data , 'a.b' ) ) . toBe ( 'foo' ) ;
73
76
expect ( lookupDottedPath ( data , 'a.c' ) ) . toBeNull ( ) ;
77
+ expect ( lookupDottedPath ( data , 'a.@d' ) ) . toBe ( 'd-foo' ) ;
78
+ expect ( lookupDottedPath ( data , '@b' ) ) . toBe ( 'b-foo' ) ;
74
79
} ) ;
75
80
76
81
it ( 'should skip over null/undefined members' , function ( ) {
0 commit comments