Skip to content

Commit 552cde9

Browse files
authored
Merge pull request #178 from erizocosmico/it/head-commits
it: head commits
2 parents f496a1e + bc54de4 commit 552cde9

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

integration_test.go

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import (
1313
)
1414

1515
func TestIntegration(t *testing.T) {
16-
t.Skipf("waiting for a fix in go-mysql-server")
17-
1816
engine := sqle.New()
1917
require.NoError(t, fixtures.Init())
2018
defer func() {
@@ -37,10 +35,9 @@ func TestIntegration(t *testing.T) {
3735
`SELECT COUNT(c.hash), c.hash
3836
FROM refs r
3937
INNER JOIN commits c
40-
ON history_idx(r.hash, c.hash) >= 0
38+
ON r.name = 'HEAD' AND history_idx(r.hash, c.hash) >= 0
4139
INNER JOIN blobs b
42-
ON commit_contains(c.hash, b.hash)
43-
WHERE r.name = 'HEAD'
40+
ON commit_has_blob(c.hash, b.hash)
4441
GROUP BY c.hash`,
4542
[]sql.Row{
4643
{int32(4), "1669dce138d9b841a518c64b10914d88f5e488ea"},
@@ -62,6 +59,23 @@ func TestIntegration(t *testing.T) {
6259
{"refs/remotes/origin/master"},
6360
},
6461
},
62+
{
63+
`SELECT c.hash
64+
FROM refs
65+
INNER JOIN commits c
66+
ON refs.name = 'HEAD'
67+
AND history_idx(refs.hash, c.hash) >= 0`,
68+
[]sql.Row{
69+
{"6ecf0ef2c2dffb796033e5a02219af86ec6584e5"},
70+
{"918c48b83bd081e863dbe1b80f8998f058cd8294"},
71+
{"af2d6a6954d532f8ffb47615169c8fdf9d383a1a"},
72+
{"1669dce138d9b841a518c64b10914d88f5e488ea"},
73+
{"a5b8b09e2f8fcb0bb99d3ccb0958157b40890d69"},
74+
{"b8e471f58bcbca63b07bda20e428190409c2db47"},
75+
{"35e85108805c84807bc66a02d91535e1e24b38b9"},
76+
{"b029517f6300c2da0f4b651b8642506cd6aaf45d"},
77+
},
78+
},
6579
}
6680

6781
for _, tt := range testCases {

0 commit comments

Comments
 (0)