mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 08:46:18 +01:00
More test cases
This commit is contained in:
parent
990de5bc7c
commit
668079474b
2 changed files with 31 additions and 0 deletions
13
test/double_extension_test.dart
Normal file
13
test/double_extension_test.dart
Normal file
|
@ -0,0 +1,13 @@
|
|||
import 'package:test/test.dart';
|
||||
import 'package:nc_photos/double_extension.dart';
|
||||
|
||||
void main() {
|
||||
group("DoubleExtension", () {
|
||||
test("toStringAsFixedTruncated", () {
|
||||
expect(1.23456.toStringAsFixedTruncated(4), "1.2346");
|
||||
expect(1.23001.toStringAsFixedTruncated(4), "1.23");
|
||||
expect(1.23.toStringAsFixedTruncated(4), "1.23");
|
||||
expect(1.0.toStringAsFixedTruncated(4), "1");
|
||||
});
|
||||
});
|
||||
}
|
18
test/string_extension_test.dart
Normal file
18
test/string_extension_test.dart
Normal file
|
@ -0,0 +1,18 @@
|
|||
import 'package:test/test.dart';
|
||||
import 'package:nc_photos/string_extension.dart';
|
||||
|
||||
void main() {
|
||||
group("StringExtension", () {
|
||||
test("trimLeftAny", () {
|
||||
expect(".,.123.,.321.,.".trimLeftAny(".,"), "123.,.321.,.");
|
||||
});
|
||||
|
||||
test("trimRightAny", () {
|
||||
expect(".,.123.,.321.,.".trimRightAny(".,"), ".,.123.,.321");
|
||||
});
|
||||
|
||||
test("trimAny", () {
|
||||
expect(".,.123.,.321.,.".trimAny(".,"), "123.,.321");
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue