Skip to content
Closed
Show file tree
Hide file tree
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 Jan 17, 2023
9974259
Fix boolean implementation
srburton Jan 18, 2023
0d2b882
Fix comments
srburton Jan 24, 2023
779da89
Add tests
srburton Jan 24, 2023
9ab8a61
Fix core patch
srburton Jan 24, 2023
ee6d93d
Fix core patch default value
srburton Jan 24, 2023
d4f158c
Fix js_helper check not nullable
srburton Jan 24, 2023
0a80fa5
Fix js_helper long line
srburton Jan 24, 2023
6e8cd34
Fix vm_shared not necessary if not nullable
srburton Jan 24, 2023
aaf3599
Fix js_helper not necessary if nullable
srburton Jan 24, 2023
a887699
Fix comment
srburton Jan 24, 2023
3bd4fea
Fix comment case-sensitive
srburton Jan 24, 2023
2f5fb3f
Fix comment format-exception
srburton Jan 24, 2023
6150fc1
Fix comment drop example
srburton Jan 24, 2023
2b07e23
Fix comment a -> an
srburton Jan 24, 2023
66b81fd
Fix add newline at end of file
srburton Jan 24, 2023
59c367e
Fix tests
srburton Jan 24, 2023
b33edce
Fix test expect throws
srburton Jan 25, 2023
42bc4f4
Fix 38 @lrhn
srburton Jan 25, 2023
f915419
Fix 725 @lrhn
srburton Jan 25, 2023
9e87d5d
Fix 725 @lrhn
srburton Jan 25, 2023
b48dd55
Fix 725 @lrhn
srburton Jan 25, 2023
82da1f5
Fix 585 @lrhn
srburton Jan 25, 2023
d4c8362
Fix 590 @lrhn
srburton Jan 25, 2023
0ebff3d
Fix 385,388,398 @lrhn
srburton Jan 25, 2023
91f53c5
Fix 31,42 @lrhn
srburton Jan 25, 2023
ff6fb9d
Fix 110,127 @lrhn
srburton Jan 25, 2023
e22b4b9
Fix 727 @lrhn
srburton Jan 26, 2023
22e5ff2
Fix 385,386,387 @lrhn
srburton Jan 26, 2023
318cf66
Fix 30,35,36 @lrhn
srburton Jan 27, 2023
4560f57
Fix 41 @lrhn
srburton Jan 27, 2023
ff0c694
Fix 108 @lrhn
srburton Jan 27, 2023
48244a6
Fix 14 @lrhn
srburton Jan 27, 2023
fee8e90
Fix tests logic
srburton Jan 27, 2023
bf71bb4
Fix 119 @athomas
srburton Jan 27, 2023
49f7806
Fix 5 @athomas
srburton Jan 27, 2023
7813830
Fix 725 @lrhn
srburton Jan 31, 2023
701d21b
Fix 587 @lrhn
srburton Jan 31, 2023
587245b
Fix 27 @lrhn
srburton Feb 1, 2023
a5c2b55
Fix 30 @lrhn
srburton Feb 1, 2023
239eeed
Fix 42 @lrhn
srburton Feb 1, 2023
ca2b430
Fix 110 @lrhn
srburton Feb 1, 2023
5b6377a
Fix 120 @lrhn
srburton Feb 1, 2023
acf4cb1
Fix 393 @lrhn
srburton Feb 1, 2023
f2526d4
Fix 590 @lrhn
srburton Feb 2, 2023
ae17e85
Fix 730 @lrhn
srburton Feb 5, 2023
52f3cc5
Fix 592 @lrhn
srburton Feb 5, 2023
78005ad
Fix 130 @lrhn
srburton Feb 5, 2023
23d444d
Fix 1 @lrhn
srburton Feb 5, 2023
d2ecd64
Fix dart format
srburton Feb 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/lib/core/bool.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ class bool {
/// ```dart
/// print(int.tryParse('true')); // true
/// print(int.tryParse('TRUE')); // true
/// print(int.tryParse('false')); // false
/// print(int.tryParse('FALSE')); // false
/// print(int.tryParse('false', caseSensitive: true)); // false
/// print(int.tryParse('FALSE', caseSensitive: true)); // false
/// print(int.tryParse('NO')); // FormatException
/// print(int.tryParse('YES')); // FormatException
/// print(int.tryParse('0')); // FormatException
Expand Down
19 changes: 19 additions & 0 deletions tests/corelib/bool_parse_test.dart
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'));
}
22 changes: 22 additions & 0 deletions tests/corelib/bool_try_parse_test.dart
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));
}