2024-09-25 04:04:57 +00:00
|
|
|
import 'package:platform_route/route.dart';
|
2024-09-23 01:46:14 +00:00
|
|
|
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': '???',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|