platform/test/uri_decode_test.dart

19 lines
471 B
Dart
Raw Normal View History

2017-11-18 05:29:08 +00:00
import 'package:angel_route/angel_route.dart';
import 'package:test/test.dart';
void main() {
test('uri params decoded', () {
var router = new Router()..get('/a/:a/b/:b', '');
var encoded =
'/a/' + Uri.encodeComponent('<<<') + '/b/' + Uri.encodeComponent('???');
print(encoded);
2017-11-25 00:26:06 +00:00
var result = router.resolveAbsolute(encoded).first;
2017-11-18 05:29:08 +00:00
print(result.allParams);
expect(result.allParams, {
'a': '<<<',
'b': '???',
});
});
}