-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add boolean parse #51026
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
Closed
Closed
Add boolean parse #51026
Changes from 2 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
b5974e9
First commit add boolean parse
srburton 9974259
Fix boolean implementation
srburton 0d2b882
Fix comments
srburton 779da89
Add tests
srburton 9ab8a61
Fix core patch
srburton ee6d93d
Fix core patch default value
srburton d4f158c
Fix js_helper check not nullable
srburton 0a80fa5
Fix js_helper long line
srburton 6e8cd34
Fix vm_shared not necessary if not nullable
srburton aaf3599
Fix js_helper not necessary if nullable
srburton a887699
Fix comment
srburton 3bd4fea
Fix comment case-sensitive
srburton 2f5fb3f
Fix comment format-exception
srburton 6150fc1
Fix comment drop example
srburton 2b07e23
Fix comment a -> an
srburton 66b81fd
Fix add newline at end of file
srburton 59c367e
Fix tests
srburton b33edce
Fix test expect throws
srburton 42bc4f4
Fix 38 @lrhn
srburton f915419
Fix 725 @lrhn
srburton 9e87d5d
Fix 725 @lrhn
srburton b48dd55
Fix 725 @lrhn
srburton 82da1f5
Fix 585 @lrhn
srburton d4c8362
Fix 590 @lrhn
srburton 0ebff3d
Fix 385,388,398 @lrhn
srburton 91f53c5
Fix 31,42 @lrhn
srburton ff6fb9d
Fix 110,127 @lrhn
srburton e22b4b9
Fix 727 @lrhn
srburton 22e5ff2
Fix 385,386,387 @lrhn
srburton 318cf66
Fix 30,35,36 @lrhn
srburton 4560f57
Fix 41 @lrhn
srburton ff0c694
Fix 108 @lrhn
srburton 48244a6
Fix 14 @lrhn
srburton fee8e90
Fix tests logic
srburton bf71bb4
Fix 119 @athomas
srburton 49f7806
Fix 5 @athomas
srburton 7813830
Fix 725 @lrhn
srburton 701d21b
Fix 587 @lrhn
srburton 587245b
Fix 27 @lrhn
srburton a5c2b55
Fix 30 @lrhn
srburton 239eeed
Fix 42 @lrhn
srburton ca2b430
Fix 110 @lrhn
srburton 5b6377a
Fix 120 @lrhn
srburton acf4cb1
Fix 393 @lrhn
srburton f2526d4
Fix 590 @lrhn
srburton ae17e85
Fix 730 @lrhn
srburton 52f3cc5
Fix 592 @lrhn
srburton 78005ad
Fix 130 @lrhn
srburton 23d444d
Fix 1 @lrhn
srburton d2ecd64
Fix dart format
srburton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 @@ | ||
| // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | ||
| // for details. All rights reserved. Use of this source code is governed by a | ||
| // BSD-style license that can be found in the LICENSE file. | ||
| // SharedOptions=-Da=true -Db=false -Dc=NOTBOOL -Dd=True | ||
|
|
||
| import "package:expect/expect.dart"; | ||
|
|
||
| main() { | ||
| Expect.isTrue(const bool.parse('true')); | ||
| Expect.isFalse(const bool.parse('false')); | ||
| Expect.isTrue(const bool.parse('TRUE', caseSensitive: true)); | ||
| Expect.isFalse(const bool.parse('FALSE', caseSensitive: true)); | ||
| Expect.throws(()=> bool.parse('True')); | ||
| Expect.throws(()=> bool.parse('False')); | ||
| Expect.throws(()=> bool.parse('y')); | ||
| Expect.throws(()=> bool.parse('n')); | ||
| Expect.throws(()=> bool.parse('0')); | ||
| Expect.throws(()=> bool.parse('1')); | ||
| } | ||
srburton marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or 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,22 @@ | ||
| // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | ||
| // for details. All rights reserved. Use of this source code is governed by a | ||
| // BSD-style license that can be found in the LICENSE file. | ||
| // SharedOptions=-Da=true -Db=false -Dc=NOTBOOL -Dd=True | ||
|
|
||
| import "package:expect/expect.dart"; | ||
|
|
||
| main() { | ||
| Expect.isTrue(const bool.tryParse('true')); | ||
| Expect.isFalse(const bool.tryParse('false')); | ||
| Expect.isTrue(const bool.tryParse('TRUE', caseSensitive: true)); | ||
| Expect.isFalse(const bool.tryParse('FALSE', caseSensitive: true)); | ||
|
|
||
| Expect.isNull(const bool.tryParse('TRUE')); | ||
| Expect.isNull(const bool.tryParse('FALSE')); | ||
| Expect.isNull(const bool.tryParse('y')); | ||
| Expect.isNull(const bool.tryParse('n')); | ||
| Expect.isNull(const bool.tryParse(' true ', caseSensitive: true)); | ||
| Expect.isNull(const bool.tryParse(' false ', caseSensitive: true)); | ||
| Expect.isNull(const bool.tryParse('0', caseSensitive: true)); | ||
| Expect.isNull(const bool.tryParse('1', caseSensitive: true)); | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.