We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 235494a commit 1d5cfe9Copy full SHA for 1d5cfe9
pkg/limayaml/load_test.go
@@ -0,0 +1,32 @@
1
+package limayaml
2
+
3
+import (
4
+ "testing"
5
6
+ "gotest.tools/v3/assert"
7
+)
8
9
+func TestLoadEmpty(t *testing.T) {
10
+ _, err := Load([]byte{}, "empty.yaml")
11
+ assert.NilError(t, err)
12
+}
13
14
+func TestLoadError(t *testing.T) {
15
+ // missing a "script:" line
16
+ s := `
17
+provision:
18
+- mode: system
19
+ script: |
20
+ #!/bin/sh
21
+ echo one
22
23
24
+ echo two
25
26
27
28
+ echo three
29
+`
30
+ _, err := Load([]byte(s), "error.yaml")
31
+ assert.ErrorContains(t, err, "failed to unmarshal YAML")
32
0 commit comments