File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
- var URL_MATCH = / ^ ( [ ^ : ] + ) : \/ \/ ( \w + : { 0 , 1 } \w * @ ) ? ( [ \w \. - ] * ) ( : ( [ 0 - 9 ] + ) ) ? ( \/ [ ^ \? # ] * ) ? ( \? ( [ ^ # ] * ) ) ? ( # ( .* ) ) ? $ / ,
3
+ var URL_MATCH = / ^ ( [ ^ : ] + ) : \/ \/ ( \w + : { 0 , 1 } \w * @ ) ? ( \{ ? [ \w \. - ] * \} ? ) ( : ( [ 0 - 9 ] + ) ) ? ( \/ [ ^ \? # ] * ) ? ( \? ( [ ^ # ] * ) ) ? ( # ( .* ) ) ? $ / ,
4
4
PATH_MATCH = / ^ ( [ ^ \? # ] * ) ? ( \? ( [ ^ # ] * ) ) ? ( # ( .* ) ) ? $ / ,
5
5
HASH_MATCH = PATH_MATCH ,
6
6
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() {
676
676
expect ( match [ 8 ] ) . toBe ( 'foo' ) ;
677
677
expect ( match [ 10 ] ) . toBe ( 'bar' ) ;
678
678
} ) ;
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
+ } ) ;
679
692
} ) ;
680
693
681
694
You can’t perform that action at this time.
0 commit comments