Skip to content

Commit fc4e175

Browse files
authored
Release 0.3.0
1 parent 531e508 commit fc4e175

File tree

6 files changed

+22
-19
lines changed

6 files changed

+22
-19
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Changelog
2+
3+
## 0.3.0
4+
5+
Null safety migration.
6+
17
## 0.2.0
28

39
Added assertions for numerical values.

example/fluent_assertions_example.dart

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import 'package:test/test.dart';
21
import 'package:fluent_assertions/fluent_assertions.dart';
2+
import 'package:test/test.dart';
33

44
void main() {
55
const adult = Person(name: 'Karol', age: 30);
@@ -42,24 +42,23 @@ void main() {
4242
});
4343
}
4444

45-
4645
class 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;

lib/src/basic_assertions.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import '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

pubspec.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: fluent_assertions
22
description: Fluent Assertions library written in Dart.
3-
version: 0.2.0
3+
version: 0.3.0
44
homepage: https://github.com/klisiewicz/fluent-assertions
55

66
environment:
7-
sdk: '>=2.6.0 <3.0.0'
7+
sdk: '>=2.12.0 <3.0.0'
88

99
dependencies:
10-
test: ^1.14.4
10+
test: ^1.17.4
1111

1212
dev_dependencies:
13-
lint: ^1.2.0
13+
lint: ^1.5.3

test/src/basic_assertions_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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', () {

test/src/person.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
class 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;

0 commit comments

Comments
 (0)