platform/packages/route/test/uri_decode_test.dart
thomashii@dukefirehawk.com 7c37497860 Publish angel3_route
2021-05-14 15:02:50 +08:00

18 lines
469 B
Dart

import 'package:angel3_route/angel3_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': '???',
});
});
}