Skip to content

Commit 9f3c871

Browse files
committed
*: add integration test for array_length(uast_extract) query
Signed-off-by: Manuel Carmona <[email protected]>
1 parent 9631e60 commit 9f3c871

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ before_script:
2323
- docker run -d --name bblfshd --privileged -p 9432:9432 -v /var/lib/bblfshd:/var/lib/bblfshd bblfsh/bblfshd
2424
- docker exec -it bblfshd bblfshctl driver install python bblfsh/python-driver
2525
- docker exec -it bblfshd bblfshctl driver install php bblfsh/php-driver
26+
- docker exec -it bblfshd bblfshctl driver install go bblfsh/go-driver
2627

2728
script:
2829
- make test-coverage codecov

integration_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,18 @@ func TestIntegration(t *testing.T) {
230230
{"e8d3ffab552895c19b9fcf7aa264d277cde33881", "some code in a branch\n", "php", "dbd3641b371024f44d0e469a9c8f5457b0660de1"},
231231
},
232232
},
233+
{
234+
`SELECT
235+
file_path, array_length(uast_extract(uast(blob_content, language(file_path)), "@type"))
236+
FROM
237+
files
238+
WHERE
239+
language(file_path)="Go"
240+
LIMIT 1`,
241+
[]sql.Row{
242+
{"go/example.go", int32(1)},
243+
},
244+
},
233245
}
234246

235247
runTests := func(t *testing.T) {

0 commit comments

Comments
 (0)