// SPDX-FileCopyrightText: 2026 FocusFlow contributors // SPDX-License-Identifier: AGPL-3.0-only /// Tests Scheduler Db behavior for the Scheduler Persistence Sqlite package. library; import 'package:drift/native.dart'; import 'package:scheduler_persistence_sqlite/sqlite.dart'; import 'package:test/test.dart'; /// Entry point for this executable Dart file. /// It wires the local command, test, or application behavior needed by this repository without exposing additional public API. void main() { test('opens schema version 1 with expected tables', () async { final db = SchedulerDb(NativeDatabase.memory()); addTearDown(db.close); expect(db.schemaVersion, 1); final rows = await db .customSelect( "SELECT name FROM sqlite_master " "WHERE type = 'table' AND name NOT LIKE 'sqlite_%' " 'ORDER BY name', ) .get(); final tableNames = rows.map((row) => row.data['name']).toList(); expect( tableNames, containsAll([ 'locked_blocks', 'locked_overrides', 'projects', 'settings', 'snapshots', 'tasks', ]), ); }); }