mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
test(link): compare canonical paths for the option terminator case
macOS temp directories live under /var, a symlink to /private/var, so EvalSymlinks on the created link returns the /private form while the test compared it with the raw t.TempDir() path. Canonicalize the expected path as well so the integration test passes on macOS runners.
This commit is contained in:
@@ -141,8 +141,13 @@ func TestLink_OptionTerminatorPath(t *testing.T) {
|
||||
checkout := filepath.Join(sb.Root, "-checkout")
|
||||
sb.WriteFile(filepath.Join(checkout, "foo", "SKILL.md"), "---\nname: foo\n---\n# foo")
|
||||
sb.RunCLIInDir(sb.Root, "link", "--global", "--", "-checkout").AssertSuccess(t)
|
||||
if got, err := filepath.EvalSymlinks(filepath.Join(sb.SourcePath, "_-checkout")); err != nil || got != checkout {
|
||||
t.Fatalf("link target = %q, %v; want %s", got, err, checkout)
|
||||
// macOS temp dirs live under /var -> /private/var, so compare canonical paths.
|
||||
want, err := filepath.EvalSymlinks(checkout)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got, err := filepath.EvalSymlinks(filepath.Join(sb.SourcePath, "_-checkout")); err != nil || got != want {
|
||||
t.Fatalf("link target = %q, %v; want %s", got, err, want)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user