Skip to content

Commit

Permalink
Fix testdata paths
Browse files Browse the repository at this point in the history
  • Loading branch information
gandarez committed Dec 5, 2024
1 parent 2bf7e0f commit 08bcf37
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/deps/deps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func TestWithDetection_NonFileType(t *testing.T) {
h := opt(func(_ context.Context, hh []heartbeat.Heartbeat) ([]heartbeat.Result, error) {
assert.Equal(t, []heartbeat.Heartbeat{
{
Entity: "testdata/codefiles/golang.go",
Entity: "testdata/golang.go",
EntityType: heartbeat.AppType,
},
}, hh)
Expand All @@ -137,7 +137,7 @@ func TestWithDetection_NonFileType(t *testing.T) {
})

result, err := h(context.Background(), []heartbeat.Heartbeat{{
Entity: "testdata/codefiles/golang.go",
Entity: "testdata/golang.go",
EntityType: heartbeat.AppType,
}})
require.NoError(t, err)
Expand Down
24 changes: 24 additions & 0 deletions pkg/language/testdata/codefiles/golang.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package main

// list every possible way of importing to try and break dependency detection
// http://learngowith.me/alternate-ways-of-importing-packages/

import "fmt"
import "compress/gzip"
import "github.com/golang/example/stringutil"
import (
"log"
"os"
)
import newname "oldname"
import . "direct"
import _ "suppress"
import (
"foobar"
_ "image/gif"
. "math"
)

func main() {
fmt.Println("Hello, World!")
}

0 comments on commit 08bcf37

Please sign in to comment.