コード例 #1
0
func TestAPTWithVersion(t *testing.T) {
	if err := apt.Install(TargetPackage, "5.0.3"); err != nil {
		t.Errorf("Install: %v", err)
	}
	if err := apt.IsInstalled(TargetPackage, ""); err != nil {
		t.Errorf("IsInstalled: %v", err)
	}
	if err := apt.Remove(TargetPackage); err != nil {
		t.Errorf("Remove: %v", err)
	}
	if err := apt.IsNotInstalled(TargetPackage); err != nil {
		t.Errorf("IsNotInstalled: %v", err)
	}
}
コード例 #2
0
// Test checks whether the package is absent on the Debian or its derivatives.
func (s *RemovedForDebian) Test() error {
	return apt.IsNotInstalled(s.Name)
}