// TestMain executes the test binary as the pack command if // GO_PACKTEST_IS_PACK is set, and runs the tests otherwise. func TestMain(m *testing.M) { … } // packPath returns the path to the "pack" binary to run. func packPath(t testing.TB) string { … } // testCreate creates an archive in the specified directory. func testCreate(t *testing.T, dir string) { … } // Test that we can create an archive, write to it, and get the same contents back. // Tests the rv and then the pv command on a new archive. func TestCreate(t *testing.T) { … } // Test that we can create an archive twice with the same name (Issue 8369). func TestCreateTwice(t *testing.T) { … } // Test that we can create an archive, put some files in it, and get back a correct listing. // Tests the tv command. func TestTableOfContents(t *testing.T) { … } // Test that we can create an archive, put some files in it, and get back a file. // Tests the x command. func TestExtract(t *testing.T) { … } // Test that pack-created archives can be understood by the tools. func TestHello(t *testing.T) { … } // Test that pack works with very long lines in PKGDEF. func TestLargeDefs(t *testing.T) { … } // Test that "\n!\n" inside export data doesn't result in a truncated // package definition when creating a .a archive from a .o Go object. func TestIssue21703(t *testing.T) { … } // Test the "c" command can "see through" the archive generated by the compiler. // This is peculiar. (See issue #43271) func TestCreateWithCompilerObj(t *testing.T) { … } // Test the "r" command creates the output file if it does not exist. func TestRWithNonexistentFile(t *testing.T) { … } // doRun runs a program in a directory and returns the output. func doRun(t *testing.T, dir string, args ...string) string { … } var helloFile … var goodbyeFile … type FakeFile … // Reset prepares a FakeFile for reuse. func (f *FakeFile) Reset() *FakeFile { … } func (f *FakeFile) Name() string { … } func (f *FakeFile) Stat() (fs.FileInfo, error) { … } func (f *FakeFile) Read(p []byte) (int, error) { … } func (f *FakeFile) Close() error { … } func (f *FakeFile) Size() int64 { … } func (f *FakeFile) Mode() fs.FileMode { … } func (f *FakeFile) ModTime() time.Time { … } func (f *FakeFile) IsDir() bool { … } func (f *FakeFile) Sys() any { … } func (f *FakeFile) String() string { … } func (f *FakeFile) Entry() *archive.Entry { … }