platform/packages/route/test/uri_decode_test.dart

19 lines
459 B
Dart
Raw Normal View History

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