Skip to content

Commit

Permalink
move dep tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matt2e committed Oct 4, 2024
1 parent c901c8d commit 70eb5bb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package buildengine
package languageplugin

import (
"context"
"testing"

"github.com/TBD54566975/ftl/internal/buildengine/languageplugin"
"github.com/TBD54566975/ftl/internal/moduleconfig"
"github.com/alecthomas/assert/v2"
)
Expand All @@ -14,17 +13,10 @@ func TestExtractModuleDepsGo(t *testing.T) {
config, err := moduleconfig.LoadModuleConfig("testdata/alpha")
assert.NoError(t, err)

plugin, err := languageplugin.PluginFromConfig(ctx, config, "")
plugin, err := PluginFromConfig(ctx, config, "")
assert.NoError(t, err)

deps, err := plugin.GetDependencies(ctx, config)
assert.NoError(t, err)
assert.Equal(t, []string{"another", "other"}, deps)
}

func TestExtractModuleDepsKotlin(t *testing.T) {
// TODO: do per language?
deps, err := extractKotlinFTLImports("test", "testdata/alphakotlin")
assert.NoError(t, err)
assert.Equal(t, []string{"builtin", "other"}, deps)
}
13 changes: 13 additions & 0 deletions internal/buildengine/languageplugin/java_plugin_tests.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package languageplugin

import (
"testing"

"github.com/alecthomas/assert/v2"
)

func TestExtractModuleDepsKotlin(t *testing.T) {
deps, err := extractKotlinFTLImports("test", "testdata/alphakotlin")
assert.NoError(t, err)
assert.Equal(t, []string{"builtin", "other"}, deps)
}

0 comments on commit 70eb5bb

Please sign in to comment.