Skip to content

Commit

Permalink
Rename links for better test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Jun 25, 2024
1 parent 71b39fa commit 5603803
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/runfiles/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def _root_symlinks_impl(ctx):
DefaultInfo(
runfiles = ctx.runfiles(
root_symlinks = {
f.basename: f
"link_" + f.basename: f
for f in ctx.files.data
},
),
Expand Down
12 changes: 6 additions & 6 deletions tests/runfiles/fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ func mainRepoRunfiles(useCanonicalName bool) []string {
var commonRunfiles = []string{
"_repo_mapping",
"bazel_tools/tools/bash/runfiles/runfiles.bash",
"test.txt",
"test_dir/file.txt",
"test_dir/subdir/other_file.txt",
"link_test.txt",
"link_test_dir/file.txt",
"link_test_dir/subdir/other_file.txt",
}

func TestFS_native(t *testing.T) {
Expand Down Expand Up @@ -157,9 +157,9 @@ func testFS(t *testing.T, r *runfiles.Runfiles) {
testFile(t, r, "io_bazel_rules_go/tests/runfiles/test.txt", "hi!\n")
testFile(t, r, "io_bazel_rules_go/tests/runfiles/test_dir/file.txt", "file\n")
testFile(t, r, "io_bazel_rules_go/tests/runfiles/test_dir/subdir/other_file.txt", "other_file\n")
testFile(t, r, "test.txt", "hi!\n")
testFile(t, r, "test_dir/file.txt", "file\n")
testFile(t, r, "test_dir/subdir/other_file.txt", "other_file\n")
testFile(t, r, "link_test.txt", "hi!\n")
testFile(t, r, "link_test_dir/file.txt", "file\n")
testFile(t, r, "link_test_dir/subdir/other_file.txt", "other_file\n")
}

func testFile(t *testing.T, r *runfiles.Runfiles, name, content string) {
Expand Down

0 comments on commit 5603803

Please sign in to comment.