github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/internal/osutils/stacktrace/stacktrace_test.go (about) 1 package stacktrace 2 3 import ( 4 "testing" 5 6 "github.com/ActiveState/cli/internal/rtutils" 7 ) 8 9 func TestGet(t *testing.T) { 10 tests := []struct { 11 name string 12 wantFirstFile string 13 }{ 14 { 15 "Stacktrace", 16 rtutils.CurrentFile(), 17 }, 18 } 19 for _, tt := range tests { 20 t.Run(tt.name, func(t *testing.T) { 21 if got := Get().Frames[0].Path; got != tt.wantFirstFile { 22 t.Errorf("Get() first file = %s, want %s", got, tt.wantFirstFile) 23 } 24 }) 25 } 26 }