File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11'use strict' ;
22
3- var URL_MATCH = / ^ ( [ ^ : ] + ) : \/ \/ ( \w + : { 0 , 1 } \w * @ ) ? ( [ \w \. - ] * ) ( : ( [ 0 - 9 ] + ) ) ? ( \/ [ ^ \? # ] * ) ? ( \? ( [ ^ # ] * ) ) ? ( # ( .* ) ) ? $ / ,
3+ var URL_MATCH = / ^ ( [ ^ : ] + ) : \/ \/ ( \w + : { 0 , 1 } \w * @ ) ? ( \{ ? [ \w \. - ] * \} ? ) ( : ( [ 0 - 9 ] + ) ) ? ( \/ [ ^ \? # ] * ) ? ( \? ( [ ^ # ] * ) ) ? ( # ( .* ) ) ? $ / ,
44 PATH_MATCH = / ^ ( [ ^ \? # ] * ) ? ( \? ( [ ^ # ] * ) ) ? ( # ( .* ) ) ? $ / ,
55 HASH_MATCH = PATH_MATCH ,
66 DEFAULT_PORTS = { 'http' : 80 , 'https' : 443 , 'ftp' : 21 } ;
Original file line number Diff line number Diff line change @@ -676,6 +676,19 @@ describe('$location', function() {
676676 expect ( match [ 8 ] ) . toBe ( 'foo' ) ;
677677 expect ( match [ 10 ] ) . toBe ( 'bar' ) ;
678678 } ) ;
679+
680+ it ( 'should parse FFOS app:// urls' , function ( ) {
681+ var match = URL_MATCH . exec ( 'app://{d0419af1-8b42-41c5-96f4-ef4179e52315}/path' ) ;
682+
683+ expect ( match [ 1 ] ) . toBe ( 'app' ) ;
684+ expect ( match [ 3 ] ) . toBe ( '{d0419af1-8b42-41c5-96f4-ef4179e52315}' ) ;
685+ expect ( match [ 5 ] ) . toBeFalsy ( ) ;
686+ expect ( match [ 6 ] ) . toBe ( '/path' ) ;
687+ expect ( match [ 8 ] ) . toBeFalsy ( ) ;
688+
689+ match = URL_MATCH . exec ( 'app://}foo{' )
690+ expect ( match ) . toBe ( null ) ;
691+ } ) ;
679692 } ) ;
680693
681694
You can’t perform that action at this time.
0 commit comments