New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "base" library. Add checked mode tester. #30
Conversation
import 'package:quiver/base.dart'; | ||
|
||
main() { | ||
test('isCheckedMode', () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put this test in a group called 'CheckedMode', and the test itself should briefly explain what's the expected outcome, e.g. "should be true".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the test since I can't figure out a way to make it make sense. I added an empty test folder for the package, not sure if that's helpful or not.
Renamed base library to testing. Moved async and time test code under testing.
I updated as suggested, please take another look:
|
part of quiver.testing; | ||
|
||
/** | ||
* Asserts that the current runtime has checked mode enabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document type of exception thrown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
I like where you are going with this! |
void assertCheckedMode() { | ||
if (_isCheckedMode == null) _isCheckedMode = _checkForCheckedMode(); | ||
|
||
assert (_isCheckedMode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't actually work - assert()s aren't run in production mode, so this won't fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good point. Changed to throw StateError.
This time I tried it by adding a "main" and verifying with dart and "dart -c". I still can't think of a way to actually test in a test, unfortunately.
…es from lib/ to lib/testing.
I think you forgot to git push :) |
So I did. Done. On Mon, Sep 30, 2013 at 5:48 PM, Yegor notifications@github.com wrote:
|
LGTM, if LG to Justin. |
/** | ||
* Asserts that the current runtime has checked mode enabled. | ||
* | ||
* Otherwise, throws [StateError}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
closing } should be a ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
LGTM too. Thanks! |
Addressed the last comments, added the top level 'runtime.dart' file for the testing.runtime library. How does this github thing work for "submitting" changes? |
As soon as you git push your latest changes one of us will hit the "Merge pull request" button :) |
Very subtle way of pointing out that I forgot to push again, thanks ;) ... done. |
Add "base" library. Add checked mode tester.
My first pull request, please take a look.
Three things for discussion:
Thanks!