mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 08:46:18 +01:00
Move test to correct package
This commit is contained in:
parent
04d7441fc0
commit
65c614940b
3 changed files with 27 additions and 26 deletions
|
@ -1,26 +0,0 @@
|
|||
import 'package:nc_photos/object_extension.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
group("ObjectExtension", () {
|
||||
test("apply", () {
|
||||
const obj = Object();
|
||||
expect(obj.apply((obj) => 1), obj);
|
||||
});
|
||||
|
||||
test("applyFuture", () async {
|
||||
const obj = Object();
|
||||
expect(await obj.applyFuture((obj) async => 1), obj);
|
||||
});
|
||||
|
||||
test("run", () {
|
||||
const obj = Object();
|
||||
expect(obj.run((obj) => 1), 1);
|
||||
});
|
||||
|
||||
test("runFuture", () async {
|
||||
const obj = Object();
|
||||
expect(await obj.runFuture((obj) => Future.value(1)), 1);
|
||||
});
|
||||
});
|
||||
}
|
|
@ -18,6 +18,7 @@ dev_dependencies:
|
|||
build_runner: ^2.2.1
|
||||
np_lints:
|
||||
path: ../np_lints
|
||||
test: ^1.21.0
|
||||
to_string_build:
|
||||
git:
|
||||
url: https://gitlab.com/nkming2/dart-to-string
|
||||
|
|
26
np_common/test/object_util_test.dart
Normal file
26
np_common/test/object_util_test.dart
Normal file
|
@ -0,0 +1,26 @@
|
|||
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);
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue