platform/packages/route/test/uri_decode_test.dart
thomashii@dukefirehawk.com f00d3916f6 Fixed route analysis warnings
2022-08-17 11:21:47 +08:00

18 lines
464 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': '???',
});
});
}