Skip to content

Commit 1fbcb5c

Browse files
committed
test: *
1 parent 245ff49 commit 1fbcb5c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/basic_test.dart

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import 'package:routingkit/routingkit.dart';
2+
import 'package:test/test.dart';
3+
4+
import 'utils/create_test_router.dart';
5+
6+
void main() {
7+
final router = createSimpleRouter([
8+
'/test',
9+
'/test/:id',
10+
'/test/:idYZ/y/z',
11+
'/test/:idY/y',
12+
'/test/foo',
13+
'/test/foo/*',
14+
'/test/foo/**',
15+
'/test/foo/bar/qux',
16+
'/test/foo/baz',
17+
'/test/fooo',
18+
'/another/path',
19+
'/wildcard/**'
20+
]);
21+
22+
test('lookup works', () {
23+
// Static
24+
expect(findRoute(router, 'GET', '/test')?.data, equals('/test'));
25+
expect(findRoute(router, 'GET', '/test/foo')?.data, equals('/test/foo'));
26+
});
27+
}

0 commit comments

Comments
 (0)