Move test to correct package

This commit is contained in:
Ming Ming 2023-12-06 22:04:49 +08:00
parent 04d7441fc0
commit 65c614940b
3 changed files with 27 additions and 26 deletions

View file

@ -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);
});
});
}

View file

@ -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

View 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);
});
});
}