forked from lukepighetti/fluro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix query string parsing. add tests. add travis config
- Loading branch information
Showing
6 changed files
with
81 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
os: | ||
- linux | ||
sudo: false | ||
addons: | ||
apt: | ||
# Flutter depends on /usr/lib/x86_64-linux-gnu/libstdc++.so.6 version GLIBCXX_3.4.18 | ||
sources: | ||
- ubuntu-toolchain-r-test # if we don't specify this, the libstdc++6 we get is the wrong version | ||
packages: | ||
- libstdc++6 | ||
- fonts-droid | ||
before_script: | ||
- ./scripts/travis_setup.sh | ||
- ./flutter/bin/flutter doctor | ||
script: | ||
- ./flutter/bin/flutter test | ||
cache: | ||
directories: | ||
- $HOME/.pub-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
git clone https://github.com/flutter/flutter.git -b alpha --depth 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:router/router.dart'; | ||
|
||
void main() { | ||
|
||
testWidgets("Router correctly parses named parameters", (WidgetTester tester) async { | ||
String path = "/users/1234"; | ||
String route = "/users/:id"; | ||
Router router = new Router(); | ||
router.define(route, handler: null); | ||
AppRouteMatch match = router.match(path); | ||
expect(match?.parameters, equals(<String, String>{ | ||
"id" : "1234", | ||
})); | ||
}); | ||
|
||
testWidgets("Router correctly parses named parameters with query", (WidgetTester tester) async { | ||
String path = "/users/1234?name=luke"; | ||
String route = "/users/:id"; | ||
Router router = new Router(); | ||
router.define(route, handler: null); | ||
AppRouteMatch match = router.match(path); | ||
expect(match?.parameters, equals(<String, String>{ | ||
"id" : "1234", | ||
"name" : "luke", | ||
})); | ||
}); | ||
|
||
testWidgets("Router correctly parses query parameters", (WidgetTester tester) async { | ||
String path = "/users/create?name=luke&phrase=hello%20world&number=7"; | ||
String route = "/users/create"; | ||
Router router = new Router(); | ||
router.define(route, handler: null); | ||
AppRouteMatch match = router.match(path); | ||
expect(match?.parameters, equals(<String, String>{ | ||
"name" : "luke", | ||
"phrase" : "hello world", | ||
"number" : "7", | ||
})); | ||
}); | ||
|
||
} |