diff --git a/tests/go/testify/lookup_spec.lua b/tests/go/testify/lookup_spec.lua index 28839a03..9fc26e8b 100644 --- a/tests/go/testify/lookup_spec.lua +++ b/tests/go/testify/lookup_spec.lua @@ -23,6 +23,7 @@ describe("Lookup", function() package = "testify", replacements = { ExampleTestSuite = "TestExampleTestSuite", + ExampleTestSuite2 = "TestExampleTestSuite2", }, }, [folderpath .. "/testname_test.go"] = { diff --git a/tests/go/testify/positions_spec.lua b/tests/go/testify/positions_spec.lua index 2b051d6c..fc160b26 100644 --- a/tests/go/testify/positions_spec.lua +++ b/tests/go/testify/positions_spec.lua @@ -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", @@ -108,14 +116,14 @@ 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", @@ -123,7 +131,7 @@ describe("With testify_enabled=true", function() }, { { - id = test_filepath .. "::ExampleTestSuite2::TestExample2", + id = test_filepath .. "::TestExampleTestSuite2::TestExample2", name = "TestExample2", path = test_filepath, type = "test", diff --git a/tests/go/testify/positions_test.go b/tests/go/testify/positions_test.go index d31dd9fd..1433aca1 100644 --- a/tests/go/testify/positions_test.go +++ b/tests/go/testify/positions_test.go @@ -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 @@ -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.