Skip to content

Commit

Permalink
test: fix incomplete tests (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikaverpil authored Jul 11, 2024
1 parent ca4f87c commit 5ac25f5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions tests/go/testify/lookup_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ describe("Lookup", function()
package = "testify",
replacements = {
ExampleTestSuite = "TestExampleTestSuite",
ExampleTestSuite2 = "TestExampleTestSuite2",
},
},
[folderpath .. "/testname_test.go"] = {
Expand Down
16 changes: 12 additions & 4 deletions tests/go/testify/positions_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ describe("With testify_enabled=false", function()
type = "test",
},
},
{
{
id = test_filepath .. "::TestExampleTestSuite2",
name = "TestExampleTestSuite2",
path = test_filepath,
type = "test",
},
},
{
{
id = test_filepath .. "::TestTrivial",
Expand Down Expand Up @@ -108,22 +116,22 @@ describe("With testify_enabled=true", function()
},
{
{
id = test_filepath .. "::ExampleTestSuite2",
name = "ExampleTestSuite2",
id = test_filepath .. "::TestExampleTestSuite2",
name = "TestExampleTestSuite2",
path = test_filepath,
type = "namespace",
},
{
{
id = test_filepath .. "::ExampleTestSuite2::TestExample",
id = test_filepath .. "::TestExampleTestSuite2::TestExample",
name = "TestExample",
path = test_filepath,
type = "test",
},
},
{
{
id = test_filepath .. "::ExampleTestSuite2::TestExample2",
id = test_filepath .. "::TestExampleTestSuite2::TestExample2",
name = "TestExample2",
path = test_filepath,
type = "test",
Expand Down
6 changes: 6 additions & 0 deletions tests/go/testify/positions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ func TestExampleTestSuite(t *testing.T) {

// --------------------------------------------------------------------

// A second suite is defined in the same file.

type ExampleTestSuite2 struct {
suite.Suite
VariableThatShouldStartAtFive int
Expand All @@ -57,6 +59,10 @@ func (suite *ExampleTestSuite2) TestExample2() {
assert.Equal(suite.T(), 5, suite.VariableThatShouldStartAtFive)
}

func TestExampleTestSuite2(t *testing.T) {
suite.Run(t, new(ExampleTestSuite2))
}

// --------------------------------------------------------------------

// Just a regular test.
Expand Down

0 comments on commit 5ac25f5

Please sign in to comment.