Created
November 6, 2015 15:59
-
-
Save emilniklas/f561b6f49f5727b9b527 to your computer and use it in GitHub Desktop.
Testing package level Dart code from the outside
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
library greeter; | |
part 'src/greeter.dart'; |
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
part of greeter; | |
class Greeter { | |
String _phrase = 'Hello'; | |
String greet(String name) => '$_phrase, $name!'; | |
} |
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
library greeter; | |
part '../lib/src/greeter.dart'; | |
main() { | |
final greeter = new Greeter(); | |
greeter._phrase = 'Testphrase'; | |
if (greeter.greet('Me') != 'Testphrase, Me!') | |
throw 'Test failed'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment