@@ -15,6 +15,7 @@ describe('$interpolate', function() {
1515
1616 it ( 'should suppress falsy objects' , inject ( function ( $interpolate ) {
1717 expect ( $interpolate ( '{{undefined}}' ) ( ) ) . toEqual ( '' ) ;
18+ expect ( $interpolate ( '{{undefined+undefined}}' ) ( ) ) . toEqual ( '' ) ;
1819 expect ( $interpolate ( '{{null}}' ) ( ) ) . toEqual ( '' ) ;
1920 expect ( $interpolate ( '{{a.b}}' ) ( ) ) . toEqual ( '' ) ;
2021 } ) ) ;
@@ -55,6 +56,31 @@ describe('$interpolate', function() {
5556 } ) ) ;
5657
5758
59+ it ( 'should ignore undefined model' , inject ( function ( $interpolate ) {
60+ expect ( $interpolate ( "Hello {{'World' + foo}}" ) ( ) ) . toEqual ( 'Hello World' ) ;
61+ } ) ) ;
62+
63+
64+ it ( 'should ignore undefined return value' , inject ( function ( $interpolate , $rootScope ) {
65+ $rootScope . foo = function ( ) { return undefined } ;
66+ expect ( $interpolate ( "Hello {{'World' + foo()}}" ) ( $rootScope ) ) . toEqual ( 'Hello World' ) ;
67+ } ) ) ;
68+
69+
70+ describe ( 'provider' , function ( ) {
71+ beforeEach ( module ( function ( $interpolateProvider ) {
72+ $interpolateProvider . startSymbol ( '--' ) ;
73+ $interpolateProvider . endSymbol ( '--' ) ;
74+ } ) ) ;
75+
76+ it ( 'should not get confused with same markers' , inject ( function ( $interpolate ) {
77+ expect ( $interpolate ( '---' ) . parts ) . toEqual ( [ '---' ] ) ;
78+ expect ( $interpolate ( '----' ) ( ) ) . toEqual ( '' ) ;
79+ expect ( $interpolate ( '--1--' ) ( ) ) . toEqual ( '1' ) ;
80+ } ) ) ;
81+ } ) ;
82+
83+
5884 describe ( 'parseBindings' , function ( ) {
5985 it ( 'should Parse Text With No Bindings' , inject ( function ( $interpolate ) {
6086 var parts = $interpolate ( "a" ) . parts ;
0 commit comments