Make the real-clock test time-independent
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
file-length / file length <= 250 lines (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint) (push) Waiting to run
Tests / test (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WzxdWZHWP4KZ6x5TcXDBFC
This commit is contained in:
Krzysztof Rudnicki 2026-11-17 22:11:23 +01:00
parent 0fbedaeecf
commit 9663738843
2 changed files with 5 additions and 8 deletions

View File

@ -2,7 +2,7 @@ name: diet_guard_app
description: "Companion phone app for diet_guard: log meals on the go."
publish_to: 'none'
version: 1.0.176+1
version: 1.0.177+1
environment:
sdk: ^3.12.2

View File

@ -115,13 +115,10 @@ void main() {
});
test('uses the real clock when now is omitted', () async {
// Just exercises the `now ?? DateTime.now()` branch without asserting
// on specific slots (which depend on the actual time the test runs).
await checkAndNotify();
expect(
notificationLog.where((c) => c.method == 'show' || c.method == 'cancel'),
isNotEmpty,
);
// Just exercises the `now ?? DateTime.now()` branch. Whether anything is
// shown or cancelled depends on the wall clock (nothing is due after the
// last slot's cutoff), so only completion is asserted.
await expectLater(checkAndNotify(), completes);
});
test('still syncs when nothing is due', () async {