mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 08:46:18 +01:00
26 lines
592 B
Dart
26 lines
592 B
Dart
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);
|
|
});
|
|
});
|
|
}
|