srawlins / timezone

Time zone database and time zone aware DateTime object for Dart.
BSD 2-Clause "Simplified" License
102 stars 53 forks source link

`Expected: TZDateTime:<2019-11-24 11:00:00.000+0100>`, `Actual: TZDateTime:<2019-11-24 11:00:00.000+0100>` #108

Closed nilsreichardt closed 1 year ago

nilsreichardt commented 3 years ago

This test fails with exception:

Expected: TZDateTime:<2019-11-24 11:00:00.000+0100>
  Actual: TZDateTime:<2019-11-24 11:00:00.000+0100>
import 'package:cron_parser/cron_parser.dart';
import 'package:test/test.dart';
import 'package:timezone/standalone.dart';

Future<void> main() async {
  await initializeTimeZone();

  group('.next()', () {
    const timezone = "Europe/Berlin";

    test('get next cron time, if matchmaking ended', () {
      final current = TZDateTime(getLocation(timezone), 2019, 11, 23, 13);
      final expected = TZDateTime(getLocation(timezone), 2019, 11, 24, 11);
      expect(
        Cron()
            .parse(
              '0 11 * * *',
              timezone,
              current,
            )
            .next(),
        expected,
      );
    });
  });
}

I'm really sure if this is a bug in the cron-parser or timezone package. But looks to that this is an issue in timezone.

Used cron_parser version 0.3.1 and timezone version 0.7.1

srawlins commented 1 year ago

I can't investigate issue with additional packages in the mix; we'd need a reproduction without cron_parser in the mix.