This commit is contained in:
Olivier Tremblay 2017-10-20 23:16:46 +00:00 committed by GitHub
commit ed1567fd7a
4 changed files with 43 additions and 27 deletions

39
Godeps/Godeps.json generated
View file

@ -1,12 +1,47 @@
{ {
"ImportPath": "github.com/avanier/jkl", "ImportPath": "otremblay.com/jkl",
"GoVersion": "go1.8", "GoVersion": "go1.9",
"GodepVersion": "v79", "GodepVersion": "v79",
"Packages": [
"./..."
],
"Deps": [ "Deps": [
{
"ImportPath": "github.com/hanwen/go-fuse/fuse",
"Comment": "v20170619-21-gcf21bc2",
"Rev": "cf21bc21cac77db799fff95d80e717908e6356a5"
},
{
"ImportPath": "github.com/hanwen/go-fuse/fuse/nodefs",
"Comment": "v20170619-21-gcf21bc2",
"Rev": "cf21bc21cac77db799fff95d80e717908e6356a5"
},
{
"ImportPath": "github.com/hanwen/go-fuse/fuse/pathfs",
"Comment": "v20170619-21-gcf21bc2",
"Rev": "cf21bc21cac77db799fff95d80e717908e6356a5"
},
{
"ImportPath": "github.com/hanwen/go-fuse/splice",
"Comment": "v20170619-21-gcf21bc2",
"Rev": "cf21bc21cac77db799fff95d80e717908e6356a5"
},
{ {
"ImportPath": "github.com/joho/godotenv", "ImportPath": "github.com/joho/godotenv",
"Comment": "v1.1-23-gc9360df", "Comment": "v1.1-23-gc9360df",
"Rev": "c9360df4d16dc0e391ea2f28da2d31a9ede2e26f" "Rev": "c9360df4d16dc0e391ea2f28da2d31a9ede2e26f"
},
{
"ImportPath": "golang.org/x/crypto/ssh/terminal",
"Rev": "541b9d50ad47e36efd8fb423e938e59ff1691f68"
},
{
"ImportPath": "golang.org/x/sys/unix",
"Rev": "8dbc5d05d6edcc104950cc299a1ce6641235bc86"
},
{
"ImportPath": "golang.org/x/sys/windows",
"Rev": "8dbc5d05d6edcc104950cc299a1ce6641235bc86"
} }
] ]
} }

View file

@ -12,7 +12,7 @@ hell
Issue Type: Sometype Issue Type: Sometype
this is ignored this is ignored
Summary: Dookienator Summary: Dookienator
also ignored`, "\n")) also ignored`, "\n"), nil)
AssertEqual(t, `Cowboys AssertEqual(t, `Cowboys
from from
hell`, iss.Fields.Description) hell`, iss.Fields.Description)

View file

@ -32,7 +32,7 @@ func (f *jklfile) String() string {
func (f *jklfile) Write(data []byte, off int64) (uint32, fuse.Status) { func (f *jklfile) Write(data []byte, off int64) (uint32, fuse.Status) {
n, err := f.File.WriteAt(data, off) n, err := f.File.WriteAt(data, off)
if err != nil { if err != nil {
return uint32(0),fuse.EACCES return uint32(0), fuse.EACCES
} }
return uint32(n), fuse.OK return uint32(n), fuse.OK
} }
@ -76,3 +76,7 @@ func (f *jklfile) SetInode(i *nodefs.Inode) {}
func (f *jklfile) Utimens(atime *time.Time, mtime *time.Time) fuse.Status { func (f *jklfile) Utimens(atime *time.Time, mtime *time.Time) fuse.Status {
return fuse.EPERM return fuse.EPERM
} }
func (f *jklfile) Flock(flags int) fuse.Status {
return fuse.ENOSYS
}

View file

@ -1,34 +1,11 @@
package jkl package jkl
import ( import (
"encoding/json"
"fmt"
"os" "os"
"testing" "testing"
"text/template" "text/template"
) )
func TestUnmarshalProjects(t *testing.T) {
f, err := os.Open("projects.json")
if err != nil {
t.Error(err)
}
dec := json.NewDecoder(f)
x := struct{ Projects []Project }{}
err = dec.Decode(&x)
if err != nil {
t.Error(err)
}
for _, p := range x.Projects {
for _, it := range p.IssueTypes {
for sn, f := range it.Fields {
fmt.Println(it.Name, sn, f.Name, f.Required, f.Schema.Type)
}
}
}
}
type TestType struct { type TestType struct {
Field string Field string
} }