test: Fix small test warnings
These were issues we should be catching.
This commit is contained in:
@@ -342,7 +342,9 @@ method instead.
|
|||||||
|
|
||||||
```golang
|
```golang
|
||||||
// moduleName is already set to "math" by the math package. Do this in `init`.
|
// moduleName is already set to "math" by the math package. Do this in `init`.
|
||||||
funcs.ModuleRegister(moduleName, "cos", func() interfaces.Func { return &CosFunc{} })
|
funcs.ModuleRegister(moduleName, "cos", func() interfaces.Func {
|
||||||
|
return &CosFunc{}
|
||||||
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
### Composite functions
|
### Composite functions
|
||||||
|
|||||||
@@ -95,7 +95,8 @@ For example, translating a plain `file` resource will lead to a warning message:
|
|||||||
|
|
||||||
```
|
```
|
||||||
$ puppet mgmtgraph print --code 'file { "/tmp/mgmt-test": }'
|
$ puppet mgmtgraph print --code 'file { "/tmp/mgmt-test": }'
|
||||||
Warning: File[/tmp/mgmt-test] uses the 'puppet' file bucket, which mgmt cannot do. There will be no backup copies!
|
Warning: File[/tmp/mgmt-test] uses the 'puppet' file bucket, which mgmt cannot
|
||||||
|
do. There will be no backup copies!
|
||||||
```
|
```
|
||||||
|
|
||||||
The reason is that per default, Puppet assumes the following parameter value
|
The reason is that per default, Puppet assumes the following parameter value
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# this combination should error
|
# this combination should error
|
||||||
pkg "cowsay" {
|
pkg "cowsay" {
|
||||||
state => "uninstalled",
|
state => "uninstalled",
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg "cowsay" {
|
pkg "cowsay" {
|
||||||
state => "installed",
|
state => "installed",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
pkg "cowsay" {
|
pkg "cowsay" {
|
||||||
state => "newest",
|
state => "newest",
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg "cowsay" {
|
pkg "cowsay" {
|
||||||
state => "installed",
|
state => "installed",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
-- main.mcl --
|
-- main.mcl --
|
||||||
$x = "top-level"
|
$x = "top-level"
|
||||||
func f1() {
|
func f1() {
|
||||||
$x + "1"
|
$x + "1"
|
||||||
}
|
}
|
||||||
$f2 = func() {
|
$f2 = func() {
|
||||||
$x + "2"
|
$x + "2"
|
||||||
}
|
}
|
||||||
$call_f1 = func($x) {
|
$call_f1 = func($x) {
|
||||||
f1() + $x
|
f1() + $x
|
||||||
}
|
}
|
||||||
$call_f2 = func($x) {
|
$call_f2 = func($x) {
|
||||||
$f2() + $x
|
$f2() + $x
|
||||||
}
|
}
|
||||||
test $call_f1("!") {}
|
test $call_f1("!") {}
|
||||||
test $call_f2("?") {}
|
test $call_f2("?") {}
|
||||||
|
|||||||
Reference in New Issue
Block a user