diff options
| author | Pete Bacon Darwin | 2013-06-20 13:59:46 +0100 | 
|---|---|---|
| committer | Pete Bacon Darwin | 2013-06-20 14:13:16 +0100 | 
| commit | 8264d08085adc2ab57f6598b9fc9f6e263c8b4f3 (patch) | |
| tree | 647bc3cf34d7ac98808518f4f98dc7175306c733 /test/AngularSpec.js | |
| parent | a7908134cb22c8c1efb21f780d4a6efdfde2b78c (diff) | |
| download | angular.js-8264d08085adc2ab57f6598b9fc9f6e263c8b4f3.tar.bz2 | |
fix(Angular.js): don't crash on invalid query parameters
Diffstat (limited to 'test/AngularSpec.js')
| -rw-r--r-- | test/AngularSpec.js | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/test/AngularSpec.js b/test/AngularSpec.js index 7c004eb1..6384302c 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -312,6 +312,12 @@ describe('angular', function() {        expect(parseKeyValue('flag1&key=value&flag2')).        toEqual({flag1: true, key: 'value', flag2: true});      }); +    it('should ignore key values that are not valid URI components', function() { +      expect(function() { parseKeyValue('%'); }).not.toThrow(); +      expect(parseKeyValue('%')).toEqual({}); +      expect(parseKeyValue('invalid=%')).toEqual({ invalid: undefined }); +      expect(parseKeyValue('invalid=%&valid=good')).toEqual({ invalid: undefined, valid: 'good' }); +    });    });    describe('toKeyValue', function() { | 
