diff --git a/examples/lang/modules/badexample1/main/h2g2.mcl b/examples/lang/modules/badexample1/main/h2g2.mcl new file mode 100644 index 00000000..54871870 --- /dev/null +++ b/examples/lang/modules/badexample1/main/h2g2.mcl @@ -0,0 +1,3 @@ +import "third.mcl" + +$answer = 42 + $third.three diff --git a/examples/lang/modules/badexample1/main/hello.mcl b/examples/lang/modules/badexample1/main/hello.mcl new file mode 100644 index 00000000..2379f520 --- /dev/null +++ b/examples/lang/modules/badexample1/main/hello.mcl @@ -0,0 +1,20 @@ +import "fmt" + +import "h2g2.mcl" + +import "mod1/" + +# imports as example1 +import "git://github.com/purpleidea/mgmt-example1/" + +$answer = $h2g2.answer + +test "hello" { + anotherstr => fmt.printf("the answer is: %d", $answer), +} +test "hello2" { + anotherstr => fmt.printf("i imported local: %s", $mod1.name), +} +test "hello3" { + anotherstr => fmt.printf("i imported remote: %s", $example1.name), +} diff --git a/examples/lang/modules/badexample1/main/mod1/main.mcl b/examples/lang/modules/badexample1/main/mod1/main.mcl new file mode 100644 index 00000000..712986b4 --- /dev/null +++ b/examples/lang/modules/badexample1/main/mod1/main.mcl @@ -0,0 +1 @@ +$name = "this is module mod1" diff --git a/examples/lang/modules/badexample1/main/third.mcl b/examples/lang/modules/badexample1/main/third.mcl new file mode 100644 index 00000000..2a030aa1 --- /dev/null +++ b/examples/lang/modules/badexample1/main/third.mcl @@ -0,0 +1 @@ +$three = 3 diff --git a/examples/lang/modules/badexample1/path/github.com/purpleidea/mgmt-example1/main.mcl b/examples/lang/modules/badexample1/path/github.com/purpleidea/mgmt-example1/main.mcl new file mode 100644 index 00000000..0465c040 --- /dev/null +++ b/examples/lang/modules/badexample1/path/github.com/purpleidea/mgmt-example1/main.mcl @@ -0,0 +1,2 @@ +# this is a pretty lame module! +$name = "i am github.com/purpleidea/mgmt-example1/" diff --git a/examples/lang/modules/badexample1/path/github.com/purpleidea/mgmt-example2/main.mcl b/examples/lang/modules/badexample1/path/github.com/purpleidea/mgmt-example2/main.mcl new file mode 100644 index 00000000..33152ebd --- /dev/null +++ b/examples/lang/modules/badexample1/path/github.com/purpleidea/mgmt-example2/main.mcl @@ -0,0 +1,6 @@ +# this is a pretty lame module! +$name = "i am github.com/purpleidea/mgmt-example2/" # + $hmmm + +# import another module +import "git://github.com/purpleidea/mgmt-example1/" +$hmmm = $example1.name