platform/packages/route/test/uri_decode_test.dart

19 lines
467 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', () {
2019-11-28 17:40:32 +00:00
var router = Router()..get('/a/:a/b/:b', '');
2017-11-18 05:29:08 +00:00
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': '???',
});
});
}