Debian Codegraph @

hardlinks_test.go

raw symbols SCIP
1 package fsutilscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/
2
3 import (
4 "testingscip-go gomod github.com/golang/go/src go1.21 testing/"
5
6 "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/"
7 )
8
9 func TestValidHardlinksscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/TestValidHardlinks().(t *testingscip-go gomod github.com/golang/go/src go1.21 testing/.Tscip-go gomod github.com/golang/go/src go1.21 testing/T#) {
10 err := checkHardlinksscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/checkHardlinks().(changeStreamscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/changeStream().([]string{
11 "ADD foo file",
12 "ADD foo2 file >foo",
13 }))
14 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.NoErrorscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/NoError().(t, err)
15 }
16
17 func TestInvalideHardlinksscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/TestInvalideHardlinks().(t *testingscip-go gomod github.com/golang/go/src go1.21 testing/.Tscip-go gomod github.com/golang/go/src go1.21 testing/T#) {
18 err := checkHardlinksscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/checkHardlinks().(changeStreamscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/changeStream().([]string{
19 "ADD foo file >foo2",
20 "ADD foo2 file",
21 }))
22 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.Errorscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/Error().(t, err)
23 }
24
25 func TestInvalideHardlinks2scip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/TestInvalideHardlinks2().(t *testingscip-go gomod github.com/golang/go/src go1.21 testing/.Tscip-go gomod github.com/golang/go/src go1.21 testing/T#) {
26 err := checkHardlinksscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/checkHardlinks().(changeStreamscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/changeStream().([]string{
27 "ADD foo file",
28 "ADD foo2 file >bar",
29 }))
30 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.Errorscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/Error().(t, err)
31 }
32
33 func TestHardlinkToDirscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/TestHardlinkToDir().(t *testingscip-go gomod github.com/golang/go/src go1.21 testing/.Tscip-go gomod github.com/golang/go/src go1.21 testing/T#) {
34 err := checkHardlinksscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/checkHardlinks().(changeStreamscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/changeStream().([]string{
35 "ADD foo dir",
36 "ADD foo2 file >foo",
37 }))
38 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.Errorscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/Error().(t, err)
39 }
40
41 func TestHardlinkToSymlinkscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/TestHardlinkToSymlink().(t *testingscip-go gomod github.com/golang/go/src go1.21 testing/.Tscip-go gomod github.com/golang/go/src go1.21 testing/T#) {
42 err := checkHardlinksscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/checkHardlinks().(changeStreamscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/changeStream().([]string{
43 "ADD foo symlink /",
44 "ADD foo2 file >foo",
45 }))
46 assertscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/.Errorscip-go gomod github.com/stretchr/testify v1.8.4 `github.com/stretchr/testify/assert`/Error().(t, err)
47 }
48
49 func checkHardlinksscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/checkHardlinks().(inp []*changescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/change#) error {
50 h := &Hardlinksscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/Hardlinks#{}
51 for _, c := range inp {
52 if err := h.HandleChangescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/Hardlinks#HandleChange().(c.kindscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/change#kind., c.pathscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/change#path., c.fiscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil`/change#fi., nil); err != nil {
53 return err
54 }
55 }
56 return nil
57 }