2021-12-02 09:27:11 +01:00
|
|
|
import 'package:nc_photos/debug_util.dart';
|
|
|
|
import 'package:test/test.dart';
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
group("debug_util", () {
|
|
|
|
group("logFilename", () {
|
|
|
|
test("null", () {
|
2024-10-20 15:49:53 +02:00
|
|
|
expect(
|
|
|
|
logFilename(null, shouldLogFileName: false),
|
|
|
|
"null",
|
|
|
|
);
|
2021-12-02 09:27:11 +01:00
|
|
|
});
|
|
|
|
test("path + name + ext", () {
|
2024-10-20 15:49:53 +02:00
|
|
|
expect(
|
|
|
|
logFilename("path/to/a/fancy_file.ext", shouldLogFileName: false),
|
|
|
|
"***/fan***ile.ext",
|
|
|
|
);
|
2021-12-02 09:27:11 +01:00
|
|
|
});
|
|
|
|
test("path + short name + ext", () {
|
2024-10-20 15:49:53 +02:00
|
|
|
expect(
|
|
|
|
logFilename("path/to/a/file01.ext", shouldLogFileName: false),
|
|
|
|
"***/file01.ext",
|
|
|
|
);
|
2021-12-02 09:27:11 +01:00
|
|
|
});
|
|
|
|
test("path + name", () {
|
2024-10-20 15:49:53 +02:00
|
|
|
expect(
|
|
|
|
logFilename("path/to/a/fancy_file", shouldLogFileName: false),
|
|
|
|
"***/fan***ile",
|
|
|
|
);
|
2021-12-02 09:27:11 +01:00
|
|
|
});
|
|
|
|
test("name + ext", () {
|
2024-10-20 15:49:53 +02:00
|
|
|
expect(
|
|
|
|
logFilename("fancy_file", shouldLogFileName: false),
|
|
|
|
"fan***ile",
|
|
|
|
);
|
2021-12-02 09:27:11 +01:00
|
|
|
});
|
|
|
|
test("name", () {
|
2024-10-20 15:49:53 +02:00
|
|
|
expect(
|
|
|
|
logFilename("fancy_file.ext", shouldLogFileName: false),
|
|
|
|
"fan***ile.ext",
|
|
|
|
);
|
2021-12-02 09:27:11 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|