Skip complex datetime test on old versions

This commit is contained in:
Simon Binder 2022-08-08 22:22:58 +02:00
parent eea63cb5c9
commit 4856ba4c5b
No known key found for this signature in database
GPG Key ID: 7891917E4147B8C0
1 changed files with 25 additions and 19 deletions

View File

@ -70,7 +70,9 @@ void _testWith(TodoDb Function() openDb, {bool dateTimeAsText = false}) {
const Duration(days: 1).inSeconds);
});
test('extracting values', () {
test(
'extracting values',
() {
final expr = Variable.withDateTime(DateTime.utc(2020, 09, 03, 23, 55));
expect(eval(expr.year), completion(2020));
@ -85,12 +87,16 @@ void _testWith(TodoDb Function() openDb, {bool dateTimeAsText = false}) {
completion('2020-09-06'));
expect(eval(expr.time), completion('23:55:00'));
expect(eval(expr.datetime), completion('2020-09-03 23:55:00'));
expect(
eval(expr.julianday), completion(closeTo(2459096.496527778, 0.0001)));
expect(eval(expr.julianday),
completion(closeTo(2459096.496527778, 0.0001)));
expect(eval(expr.unixepoch), completion(1599177300));
expect(eval(expr.strftime('%Y-%m-%d %H:%M:%S')),
completion('2020-09-03 23:55:00'));
});
},
skip: sqlite3Version.versionNumber < 3039000
? 'Requires sqlite 3.39'
: null,
);
DateTime result(DateTime date) {
if (dateTimeAsText) {