nc-photos/np_common/test/object_util_test.dart

27 lines
592 B
Dart
Raw Normal View History

2023-12-06 15:04:49 +01:00
import 'package:np_common/object_util.dart';
import 'package:test/test.dart';
void main() {
group("ObjectExtension", () {
test("also", () {
const obj = Object();
expect(obj.also((obj) => 1), obj);
});
test("alsoFuture", () async {
const obj = Object();
expect(await obj.alsoFuture((obj) async => 1), obj);
});
test("let", () {
const obj = Object();
expect(obj.let((obj) => 1), 1);
});
test("letFuture", () async {
const obj = Object();
expect(await obj.letFuture((obj) => Future.value(1)), 1);
});
});
}