platform/packages/route/test/uri_decode_test.dart
Tobe O 5eef4314ec Add 'packages/route/' from commit '8b2b0524609ab737eb5569fdf82a7ac491fdc67b'
git-subtree-dir: packages/route
git-subtree-mainline: 6db839928b
git-subtree-split: 8b2b052460
2020-02-15 18:22:17 -05:00

18 lines
467 B
Dart

import 'package:angel_route/angel_route.dart';
import 'package:test/test.dart';
void main() {
test('uri params decoded', () {
var router = Router()..get('/a/:a/b/:b', '');
var encoded =
'/a/' + Uri.encodeComponent('<<<') + '/b/' + Uri.encodeComponent('???');
print(encoded);
var result = router.resolveAbsolute(encoded).first;
print(result.allParams);
expect(result.allParams, {
'a': '<<<',
'b': '???',
});
});
}