Skip to content

Commit 243bb33

Browse files
committed
Fix tests
1 parent 48ad725 commit 243bb33

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.github/workflows/chdb.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
go mod tidy
2424
make build
2525
- name: Test
26+
run: make test
27+
- name: Test main
2628
run: LD_LIBRARY_PATH=./ ./chdb-go "SELECT 12345"
2729

2830
build_mac:
@@ -41,5 +43,7 @@ jobs:
4143
go mod tidy
4244
make build
4345
- name: Test
46+
run: make test
47+
- name: Test main
4448
run: ./chdb-go "SELECT 12345"
4549

chdbstable/chdb_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ func TestQueryStableMultipleCases(t *testing.T) {
2222
expectOutput: "123\n",
2323
},
2424
{
25-
name: "Multiple Queries",
25+
name: "Single Queries",
2626
argv: []string{"clickhouse", "--multiquery", "--output-format=CSV", "--query=SELECT 'abc';"},
2727
expectError: false,
28-
expectOutput: "abc",
28+
expectOutput: "\"abc\"\n",
2929
},
3030
}
3131

@@ -35,11 +35,11 @@ func TestQueryStableMultipleCases(t *testing.T) {
3535
result := QueryStable(len(tc.argv), tc.argv)
3636

3737
// Assert based on the expected outcome of the test case
38-
if (result == nil) != tc.expectError {
38+
if (result == nil) && tc.expectError {
3939
t.Errorf("QueryStable() with args %v, expect error: %v, got result: %v", tc.argv, tc.expectError, result)
4040
}
4141

42-
if (result != nil) && (string(result) != tc.expectOutput) {
42+
if (result != nil) && string(result.Buf()) != tc.expectOutput {
4343
t.Errorf("QueryStable() with args %v, expect output: %v, got output: %v", tc.argv, tc.expectOutput, string(result.Buf()))
4444
}
4545
})

0 commit comments

Comments
 (0)