Skip to content

Commit

Permalink
test: Add negative test for wrong file skipping
Browse files Browse the repository at this point in the history
  • Loading branch information
varungandhi-src committed Sep 24, 2024
1 parent 3aaa77b commit fd3c308
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/testdata/snapshots/input/testspecial/foo.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package testspecial

func Foo() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package testspecial_test

import (
"testing"

"sg/testspecial"
)

func TestFoo_Blackbox(*testing.T) { testspecial.Foo() }
3 changes: 3 additions & 0 deletions internal/testdata/snapshots/input/testspecial/foo_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package testspecial

func TestFoo_Whitebox() { Foo() }
3 changes: 3 additions & 0 deletions internal/testdata/snapshots/input/testspecial/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module sg/testspecial

go 1.19
12 changes: 12 additions & 0 deletions internal/testdata/snapshots/output/testspecial/foo.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package testspecial
// ^^^^^^^^^^^ definition 0.1.test `sg/testspecial`/
// documentation
// > package testspecial

func Foo() {}
// ^^^ definition 0.1.test `sg/testspecial`/Foo().
// documentation
// > ```go
// > func Foo()
// > ```

24 changes: 24 additions & 0 deletions internal/testdata/snapshots/output/testspecial/foo_other_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package testspecial_test
// ^^^^^^^^^^^^^^^^ definition 0.1.test `sg/testspecial_test`/
// documentation
// > package testspecial_test

import (
"testing"
// ^^^^^^^ reference github.com/golang/go/src go1.22 testing/

"sg/testspecial"
// ^^^^^^^^^^^^^^ reference 0.1.test `sg/testspecial`/
)

func TestFoo_Blackbox(*testing.T) { testspecial.Foo() }
// ^^^^^^^^^^^^^^^^ definition 0.1.test `sg/testspecial_test`/TestFoo_Blackbox().
// documentation
// > ```go
// > func TestFoo_Blackbox(*T)
// > ```
// ^^^^^^^ reference github.com/golang/go/src go1.22 testing/
// ^ reference github.com/golang/go/src go1.22 testing/T#
// ^^^^^^^^^^^ reference 0.1.test `sg/testspecial`/
// ^^^ reference 0.1.test `sg/testspecial`/Foo().

0 comments on commit fd3c308

Please sign in to comment.