Skip to content

Commit dccc4c0

Browse files
committed
add tests
1 parent 945b632 commit dccc4c0

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

‎.github/workflows/flutter_ci.yml‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Flutter CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Flutter
18+
uses: subosito/flutter-action@v2
19+
with:
20+
channel: 'stable'
21+
# If your app requires a specific version, you can specify it here:
22+
# flutter-version: '3.19.0'
23+
24+
- name: Install dependencies
25+
run: flutter pub get
26+
27+
- name: Verify formatting
28+
run: dart format --output=none --set-exit-if-changed .
29+
30+
- name: Analyze project source
31+
run: flutter analyze
32+
33+
- name: Run unit tests
34+
run: flutter test

‎lib/db.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class DatabaseHelper {
3232
db.select('SELECT count(*) FROM sqlite_schema;');
3333
} catch (e) {
3434
// Wrong password or corrupted database
35-
db.dispose();
35+
db.close();
3636
return false;
3737
}
3838

@@ -71,7 +71,7 @@ class DatabaseHelper {
7171
}
7272

7373
void dispose() {
74-
db.dispose();
74+
db.close();
7575
}
7676

7777
void insertMessage(String role, String content) {

0 commit comments

Comments
 (0)