File tree Expand file tree Collapse file tree 6 files changed +22
-19
lines changed Expand file tree Collapse file tree 6 files changed +22
-19
lines changed Original file line number Diff line number Diff line change 1+ # Changelog
2+
3+ ## 0.3.0
4+
5+ Null safety migration.
6+
17## 0.2.0
28
39Added assertions for numerical values.
Original file line number Diff line number Diff line change 1- import 'package:test/test.dart' ;
21import 'package:fluent_assertions/fluent_assertions.dart' ;
2+ import 'package:test/test.dart' ;
33
44void main () {
55 const adult = Person (name: 'Karol' , age: 30 );
@@ -42,24 +42,23 @@ void main() {
4242 });
4343}
4444
45-
4645class Person {
4746 final String name;
4847 final int age;
4948 bool get isAdult => age >= 18 ;
5049
5150 const Person ({
52- this .name,
53- this .age,
51+ required this .name,
52+ required this .age,
5453 });
5554
5655 @override
5756 bool operator == (Object other) =>
5857 identical (this , other) ||
59- other is Person &&
60- runtimeType == other.runtimeType &&
61- name == other.name &&
62- age == other.age;
58+ other is Person &&
59+ runtimeType == other.runtimeType &&
60+ name == other.name &&
61+ age == other.age;
6362
6463 @override
6564 int get hashCode => name.hashCode ^ age.hashCode;
Original file line number Diff line number Diff line change 11import 'package:test/test.dart' ;
22
3- extension BasicAssertions <T > on T {
3+ extension BasicAssertions <T > on T ? {
44 /// Asserts that the value is structurally equal to [expected] .
55 void shouldBeEqualTo (T expected) => expect (this , equals (expected));
66
Original file line number Diff line number Diff line change 11name : fluent_assertions
22description : Fluent Assertions library written in Dart.
3- version : 0.2 .0
3+ version : 0.3 .0
44homepage : https://github.com/klisiewicz/fluent-assertions
55
66environment :
7- sdk : ' >=2.6 .0 <3.0.0'
7+ sdk : ' >=2.12 .0 <3.0.0'
88
99dependencies :
10- test : ^1.14 .4
10+ test : ^1.17 .4
1111
1212dev_dependencies :
13- lint : ^1.2.0
13+ lint : ^1.5.3
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ void main() {
137137 });
138138
139139 group ('nullability' , () {
140- const Person nullPerson = null ;
140+ const Person ? nullPerson = null ;
141141 final me = Person (name: 'Karol' );
142142
143143 test ('should return normally when null' , () {
Original file line number Diff line number Diff line change 11class Person {
22 final String name;
33
4- Person ({
5- this .name,
4+ const Person ({
5+ required this .name,
66 });
77
88 @override
99 bool operator == (Object other) =>
1010 identical (this , other) ||
11- other is Person &&
12- runtimeType == other.runtimeType &&
13- name == other.name;
11+ other is Person && runtimeType == other.runtimeType && name == other.name;
1412
1513 @override
1614 int get hashCode => name.hashCode;
You can’t perform that action at this time.
0 commit comments