@@ -31,18 +31,6 @@ describe('$interpolate', function() {
3131 expect ( $interpolate ( 'Hello {{name}}!' ) ( $rootScope ) ) . toEqual ( 'Hello Misko!' ) ;
3232 } ) ) ;
3333
34- describe ( 'provider' , function ( ) {
35- beforeEach ( module ( function ( $interpolateProvider ) {
36- $interpolateProvider . startSymbol ( '--' ) ;
37- $interpolateProvider . endSymbol ( '--' ) ;
38- } ) ) ;
39-
40- it ( 'should not get confused with same markers' , inject ( function ( $interpolate ) {
41- expect ( $interpolate ( '---' ) . parts ) . toEqual ( [ '---' ] ) ;
42- expect ( $interpolate ( '----' ) ( ) ) . toEqual ( '' ) ;
43- expect ( $interpolate ( '--1--' ) ( ) ) . toEqual ( '1' ) ;
44- } ) ) ;
45- } ) ;
4634
4735 describe ( 'parseBindings' , function ( ) {
4836 it ( 'should Parse Text With No Bindings' , inject ( function ( $interpolate ) {
@@ -110,4 +98,46 @@ describe('$interpolate', function() {
11098 expect ( parts [ 2 ] ) . toEqual ( 'C\nD"' ) ;
11199 } ) ) ;
112100 } ) ;
101+
102+
103+ describe ( 'startSymbol' , function ( ) {
104+
105+ beforeEach ( module ( function ( $interpolateProvider ) {
106+ expect ( $interpolateProvider . startSymbol ( ) ) . toBe ( '{{' ) ;
107+ $interpolateProvider . startSymbol ( '((' ) ;
108+ } ) ) ;
109+
110+
111+ it ( 'should expose the startSymbol in config phase' , module ( function ( $interpolateProvider ) {
112+ expect ( $interpolateProvider . startSymbol ( ) ) . toBe ( '((' ) ;
113+ } ) ) ;
114+
115+
116+ it ( 'should not get confused by matching start and end symbols' , function ( ) {
117+ module ( function ( $interpolateProvider ) {
118+ $interpolateProvider . startSymbol ( '--' ) ;
119+ $interpolateProvider . endSymbol ( '--' ) ;
120+ } ) ;
121+
122+ inject ( function ( $interpolate ) {
123+ expect ( $interpolate ( '---' ) . parts ) . toEqual ( [ '---' ] ) ;
124+ expect ( $interpolate ( '----' ) ( ) ) . toEqual ( '' ) ;
125+ expect ( $interpolate ( '--1--' ) ( ) ) . toEqual ( '1' ) ;
126+ } ) ;
127+ } ) ;
128+ } ) ;
129+
130+
131+ describe ( 'endSymbol' , function ( ) {
132+
133+ beforeEach ( module ( function ( $interpolateProvider ) {
134+ expect ( $interpolateProvider . endSymbol ( ) ) . toBe ( '}}' ) ;
135+ $interpolateProvider . endSymbol ( '))' ) ;
136+ } ) ) ;
137+
138+
139+ it ( 'should expose the endSymbol in config phase' , module ( function ( $interpolateProvider ) {
140+ expect ( $interpolateProvider . endSymbol ( ) ) . toBe ( '))' ) ;
141+ } ) ) ;
142+ } ) ;
113143} ) ;
0 commit comments