-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b98907a
commit cd08733
Showing
4 changed files
with
153 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
local _ = require("plenary") | ||
|
||
local results_dir = require("neotest-golang.results_dir") | ||
|
||
describe("Common parts of Go package and folderpath", function() | ||
it("Root repo - ok", function() | ||
local line_package = "github.com/fredrikaverpil/my-service" | ||
local folderpath = "/Users/fredrik/code/work/private/my-service" | ||
|
||
local partial_path = results_dir.common_parts(line_package, folderpath) | ||
assert.are_equal(partial_path, "my-service") | ||
end) | ||
|
||
it("Repo sub-folder - ok", function() | ||
local line_package = "github.com/fredrikaverpil/my-service/backend" | ||
local folderpath = "/Users/fredrik/code/work/private/my-service/backend" | ||
|
||
local partial_path = results_dir.common_parts(line_package, folderpath) | ||
assert.are_equal(partial_path, "my-service/backend") | ||
end) | ||
|
||
it("Deep repo sub folder - ok", function() | ||
local line_package = | ||
"github.com/fredrikaverpil/my-service/backend/internal/outbound/spanner" | ||
local folderpath = | ||
"/Users/fredrik/code/work/private/my-service/backend/internal/outbound/spanner" | ||
|
||
local partial_path = results_dir.common_parts(line_package, folderpath) | ||
assert.are_equal( | ||
partial_path, | ||
"my-service/backend/internal/outbound/spanner" | ||
) | ||
end) | ||
end) |