1- package simpleyaml
1+ package simpleyaml_test
22
33import (
44 "testing"
5+ "github.com/smallfish/simpleyaml"
6+ "github.com/smallfish/simpleyaml/helper/util"
57)
68
79var data = []byte (`
2325` )
2426
2527func TestBool (t * testing.T ) {
26- y , err := NewYaml (data )
28+ y , err := simpleyaml . NewYaml (data )
2729 if err != nil {
2830 t .Fatal ("init yaml failed" )
2931 }
@@ -38,7 +40,7 @@ func TestBool(t *testing.T) {
3840}
3941
4042func TestString (t * testing.T ) {
41- y , err := NewYaml (data )
43+ y , err := simpleyaml . NewYaml (data )
4244 if err != nil {
4345 t .Fatal ("init yaml failed" )
4446 }
@@ -53,7 +55,7 @@ func TestString(t *testing.T) {
5355}
5456
5557func TestStringFromIntKey (t * testing.T ) {
56- y , err := NewYaml (data )
58+ y , err := simpleyaml . NewYaml (data )
5759 if err != nil {
5860 t .Fatal ("init yaml failed" )
5961 }
@@ -69,7 +71,7 @@ func TestStringFromIntKey(t *testing.T) {
6971}
7072
7173func TestFloat (t * testing.T ) {
72- y , err := NewYaml (data )
74+ y , err := simpleyaml . NewYaml (data )
7375 if err != nil {
7476 t .Fatal ("init yaml failed" )
7577 }
@@ -85,7 +87,7 @@ func TestFloat(t *testing.T) {
8587}
8688
8789func TestInt (t * testing.T ) {
88- y , err := NewYaml (data )
90+ y , err := simpleyaml . NewYaml (data )
8991 if err != nil {
9092 t .Fatal ("init yaml failed" )
9193 }
@@ -100,7 +102,7 @@ func TestInt(t *testing.T) {
100102}
101103
102104func TestGetIndex (t * testing.T ) {
103- y , err := NewYaml (data )
105+ y , err := simpleyaml . NewYaml (data )
104106 if err != nil {
105107 t .Fatal ("init yaml failed" )
106108 }
@@ -112,7 +114,7 @@ func TestGetIndex(t *testing.T) {
112114}
113115
114116func TestString2 (t * testing.T ) {
115- y , err := NewYaml (data )
117+ y , err := simpleyaml . NewYaml (data )
116118 if err != nil {
117119 t .Fatal ("init yaml failed" )
118120 }
@@ -127,7 +129,7 @@ func TestString2(t *testing.T) {
127129}
128130
129131func TestGetPath (t * testing.T ) {
130- y , err := NewYaml (data )
132+ y , err := simpleyaml . NewYaml (data )
131133 if err != nil {
132134 t .Fatal ("init yaml failed" )
133135 }
@@ -142,14 +144,14 @@ func TestGetPath(t *testing.T) {
142144}
143145
144146func TestGetAllPaths (t * testing.T ) {
145- y , err := NewYaml (data )
147+ y , err := simpleyaml . NewYaml (data )
146148 if err != nil {
147149 t .Fatal ("init yaml failed" )
148150 }
149151
150- v := y .GetAllPaths ()
152+ v , err := util .GetAllPaths (y )
151153 if err != nil {
152- t .Fatal ("get yaml failed" )
154+ t .Fatal ("Getting all paths failed" )
153155 }
154156
155157 t .Log (v )
@@ -159,7 +161,7 @@ func TestGetAllPaths(t *testing.T) {
159161}
160162
161163func TestArray (t * testing.T ) {
162- y , err := NewYaml (data )
164+ y , err := simpleyaml . NewYaml (data )
163165 if err != nil {
164166 t .Fatal ("init yaml failed" )
165167 }
@@ -174,7 +176,7 @@ func TestArray(t *testing.T) {
174176}
175177
176178func TestMap (t * testing.T ) {
177- y , err := NewYaml (data )
179+ y , err := simpleyaml . NewYaml (data )
178180 if err != nil {
179181 t .Fatal ("init yaml failed" )
180182 }
@@ -192,7 +194,7 @@ func TestMap(t *testing.T) {
192194}
193195
194196func TestIsFound (t * testing.T ) {
195- y , err := NewYaml (data )
197+ y , err := simpleyaml . NewYaml (data )
196198 if err != nil {
197199 t .Fatal ("init yaml failed" )
198200 }
0 commit comments