Exemplo n.º 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)
	}
}
// Test checks whether the package is successfully installed on the platform of
// Debian or its derivatives.
func (s *InstalledForDebian) Test() error {
	return apt.IsInstalled(s.Name, s.Version)
}