Permalink
Browse files

goyaml is now yaml.

  • Loading branch information...
1 parent 2628b30 commit ca3d523f32f3b33fb3265bfeb8e11003a8670e3d @niemeyer niemeyer committed Mar 5, 2014
Showing with 33 additions and 372 deletions.
  1. +0 −39 Makefile
  2. +1 −1 apic.go
  3. +1 −1 decode.go
  4. +11 −11 decode_test.go
  5. +1 −1 emitterc.go
  6. +1 −1 encode.go
  7. +9 −9 encode_test.go
  8. +0 −300 goyaml.go
  9. +1 −1 parserc.go
  10. +1 −1 readerc.go
  11. +1 −1 resolve.go
  12. +1 −1 scannerc.go
  13. +1 −1 sorter.go
  14. +1 −1 suite_test.go
  15. +1 −1 writerc.go
  16. +1 −1 yamlh.go
  17. +1 −1 yamlprivateh.go
View
@@ -1,39 +0,0 @@
-include $(GOROOT)/src/Make.inc
-
-YAML=yaml-0.1.3
-LIBYAML=$(PWD)/$(YAML)/src/.libs/libyaml.a
-
-TARG=launchpad.net/goyaml
-
-GOFILES=\
- goyaml.go\
- resolve.go\
-
-CGOFILES=\
- decode.go\
- encode.go\
-
-CGO_OFILES+=\
- helpers.o\
- api.o\
- scanner.o\
- reader.o\
- parser.o\
- writer.o\
- emitter.o\
-
-GOFMT=gofmt
-
-BADFMT:=$(shell $(GOFMT) -l $(GOFILES) $(CGOFILES) $(wildcard *_test.go))
-
-all: package
-gofmt: $(BADFMT)
- @for F in $(BADFMT); do $(GOFMT) -w $$F && echo $$F; done
-
-include $(GOROOT)/src/Make.pkg
-
-ifneq ($(BADFMT),)
-ifneq ($(MAKECMDGOALS),gofmt)
-$(warning WARNING: make gofmt: $(BADFMT))
-endif
-endif
View
@@ -1,4 +1,4 @@
-package goyaml
+package yaml
import (
"io"
View
@@ -1,4 +1,4 @@
-package goyaml
+package yaml
import (
"reflect"
View
@@ -1,8 +1,8 @@
-package goyaml_test
+package yaml_test
import (
. "launchpad.net/gocheck"
- "launchpad.net/goyaml"
+ "gonuts.org/v1/yaml"
"math"
"reflect"
)
@@ -377,7 +377,7 @@ func (s *S) TestUnmarshal(c *C) {
pv := reflect.New(pt.Elem())
value = pv.Interface()
}
- err := goyaml.Unmarshal([]byte(item.data), value)
+ err := yaml.Unmarshal([]byte(item.data), value)
c.Assert(err, IsNil, Commentf("Item #%d", i))
if t.Kind() == reflect.String {
c.Assert(*value.(*string), Equals, item.value, Commentf("Item #%d", i))
@@ -389,7 +389,7 @@ func (s *S) TestUnmarshal(c *C) {
func (s *S) TestUnmarshalNaN(c *C) {
value := map[string]interface{}{}
- err := goyaml.Unmarshal([]byte("notanum: .NaN"), &value)
+ err := yaml.Unmarshal([]byte("notanum: .NaN"), &value)
c.Assert(err, IsNil)
c.Assert(math.IsNaN(value["notanum"].(float64)), Equals, true)
}
@@ -408,7 +408,7 @@ var unmarshalErrorTests = []struct {
func (s *S) TestUnmarshalErrors(c *C) {
for _, item := range unmarshalErrorTests {
var value interface{}
- err := goyaml.Unmarshal([]byte(item.data), &value)
+ err := yaml.Unmarshal([]byte(item.data), &value)
c.Assert(err, ErrorMatches, item.error, Commentf("Partial unmarshal: %#v", value))
}
}
@@ -449,7 +449,7 @@ type typeWithSetterField struct {
func (s *S) TestUnmarshalWithSetter(c *C) {
for _, item := range setterTests {
obj := &typeWithSetterField{}
- err := goyaml.Unmarshal([]byte(item.data), obj)
+ err := yaml.Unmarshal([]byte(item.data), obj)
c.Assert(err, IsNil)
c.Assert(obj.Field, NotNil,
Commentf("Pointer not initialized (%#v)", item.value))
@@ -460,7 +460,7 @@ func (s *S) TestUnmarshalWithSetter(c *C) {
func (s *S) TestUnmarshalWholeDocumentWithSetter(c *C) {
obj := &typeWithSetter{}
- err := goyaml.Unmarshal([]byte(setterTests[0].data), obj)
+ err := yaml.Unmarshal([]byte(setterTests[0].data), obj)
c.Assert(err, IsNil)
c.Assert(obj.tag, Equals, setterTests[0].tag)
value, ok := obj.value.(map[interface{}]interface{})
@@ -478,7 +478,7 @@ func (s *S) TestUnmarshalWithFalseSetterIgnoresValue(c *C) {
m := map[string]*typeWithSetter{}
data := "{abc: 1, def: 2, ghi: 3, jkl: 4}"
- err := goyaml.Unmarshal([]byte(data), m)
+ err := yaml.Unmarshal([]byte(data), m)
c.Assert(err, IsNil)
c.Assert(m["abc"], NotNil)
c.Assert(m["def"], IsNil)
@@ -502,7 +502,7 @@ func (s *S) TestUnmarshalWithFalseSetterIgnoresValue(c *C) {
// var err error
// for i := 0; i < c.N; i++ {
// var v map[string]interface{}
-// err = goyaml.Unmarshal(data, &v)
+// err = yaml.Unmarshal(data, &v)
// }
// if err != nil {
// panic(err)
@@ -511,9 +511,9 @@ func (s *S) TestUnmarshalWithFalseSetterIgnoresValue(c *C) {
//
//func (s *S) BenchmarkMarshal(c *C) {
// var v map[string]interface{}
-// goyaml.Unmarshal(data, &v)
+// yaml.Unmarshal(data, &v)
// c.ResetTimer()
// for i := 0; i < c.N; i++ {
-// goyaml.Marshal(&v)
+// yaml.Marshal(&v)
// }
//}
View
@@ -1,4 +1,4 @@
-package goyaml
+package yaml
import (
"bytes"
View
@@ -1,4 +1,4 @@
-package goyaml
+package yaml
import (
"reflect"
View
@@ -1,9 +1,9 @@
-package goyaml_test
+package yaml_test
import (
"fmt"
. "launchpad.net/gocheck"
- "launchpad.net/goyaml"
+ "gonuts.org/v1/yaml"
"math"
"strconv"
"strings"
@@ -216,7 +216,7 @@ var marshalTests = []struct {
func (s *S) TestMarshal(c *C) {
for _, item := range marshalTests {
- data, err := goyaml.Marshal(item.value)
+ data, err := yaml.Marshal(item.value)
c.Assert(err, IsNil)
c.Assert(string(data), Equals, item.data)
}
@@ -237,7 +237,7 @@ var marshalErrorTests = []struct {
func (s *S) TestMarshalErrors(c *C) {
for _, item := range marshalErrorTests {
- _, err := goyaml.Marshal(item.value)
+ _, err := yaml.Marshal(item.value)
c.Assert(err, ErrorMatches, item.error)
}
}
@@ -269,12 +269,12 @@ func (s *S) TestMarshalTypeCache(c *C) {
var err error
func() {
type T struct{ A int }
- data, err = goyaml.Marshal(&T{})
+ data, err = yaml.Marshal(&T{})
c.Assert(err, IsNil)
}()
func() {
type T struct{ B int }
- data, err = goyaml.Marshal(&T{})
+ data, err = yaml.Marshal(&T{})
c.Assert(err, IsNil)
}()
c.Assert(string(data), Equals, "b: 0\n")
@@ -298,7 +298,7 @@ func (s *S) TestMashalWithGetter(c *C) {
obj := &typeWithGetterField{}
obj.Field.tag = item.tag
obj.Field.value = item.value
- data, err := goyaml.Marshal(obj)
+ data, err := yaml.Marshal(obj)
c.Assert(err, IsNil)
c.Assert(string(data), Equals, string(item.data))
}
@@ -308,7 +308,7 @@ func (s *S) TestUnmarshalWholeDocumentWithGetter(c *C) {
obj := &typeWithGetter{}
obj.tag = ""
obj.value = map[string]string{"hello": "world!"}
- data, err := goyaml.Marshal(obj)
+ data, err := yaml.Marshal(obj)
c.Assert(err, IsNil)
c.Assert(string(data), Equals, "hello: world!\n")
}
@@ -356,7 +356,7 @@ func (s *S) TestSortedOutput(c *C) {
for _, k := range order {
m[k] = 1
}
- data, err := goyaml.Marshal(m)
+ data, err := yaml.Marshal(m)
c.Assert(err, IsNil)
out := "\n" + string(data)
last := 0
Oops, something went wrong.

0 comments on commit ca3d523

Please sign in to comment.