70a88ca8b4
IMPROVED: * Removed *BROKEN* dep. lrn2fixurshitk
40 lines
657 B
Go
40 lines
657 B
Go
package auger
|
|
|
|
import (
|
|
"testing"
|
|
|
|
`honnef.co/go/augeas`
|
|
)
|
|
|
|
func TestNewAuger(t *testing.T) {
|
|
|
|
var aug *Aug
|
|
var augUnder augeas.Augeas
|
|
var err error
|
|
|
|
if aug, err = NewAuger("/", "", nil); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
augUnder = aug.aug
|
|
|
|
aug = NewAugerFromAugeas(augUnder)
|
|
|
|
_ = aug
|
|
}
|
|
|
|
func TestRecursiveInclude(t *testing.T) {
|
|
|
|
var aug *Aug
|
|
var err error
|
|
|
|
if aug, err = NewAuger("/", "", &AugFlags{DryRun: PtrTrue}); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
// This requires Nginx to be installed and with a particularly complex nested include system.
|
|
if err = aug.RecursiveInclude("Nginx", "include", "/etc/nginx"); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
}
|