Skip to content

Comparing dirs with symlinks does not work #141

@mat007

Description

@mat007

The following test

func TestSymlinks(t *testing.T) {
	rootDirectory := fs.NewDir(t, "root",
		fs.WithDir("source",
			fs.WithFile("foo.txt", "foo"),
			fs.WithSymlink("fool.txt", "foo.txt"),
			fs.WithSymlink("sourcel", "source")))
	defer rootDirectory.Remove()
	expected := fs.Expected(t,
		fs.WithDir("source",
			fs.WithFile("foo.txt", "foo"),
			fs.WithSymlink("fool.txt", "foo.txt"),
			fs.WithSymlink("sourcel", "source")))
	assert.Assert(t, fs.Equal(rootDirectory.Path(), expected))
}

fails on Mac with Go 1.11 with


--- FAIL: TestTarSymlinks (0.00s)
    ....._test.go:82: assertion failed: directory /var/folders/3f/77_0lxwn02x9v1rxz9314qzc0000gp/T/root-331223324 does not match expected:
        /source/fool.txt
          mode: expected Lrwxrwxrwx got Lrwxr-xr-x
          target: expected foo.txt got /var/folders/3f/77_0lxwn02x9v1rxz9314qzc0000gp/T/root-331223324/source/foo.txt
        /source/sourcel
          mode: expected Lrwxrwxrwx got Lrwxr-xr-x
          target: expected source got /var/folders/3f/77_0lxwn02x9v1rxz9314qzc0000gp/T/root-331223324/source/source

Did I miss something obvious?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions