fix module/package paths
This commit is contained in:
parent
f3b42297d4
commit
52b3a89e51
@ -5,7 +5,7 @@ package fixture_test
|
||||
import (
|
||||
"testing"
|
||||
"math"
|
||||
"testing/fixture"
|
||||
"gitea.rosskeen.house/rosskeen.house/testing/fixture"
|
||||
)
|
||||
|
||||
func Fixture2Pow(p fixture.Param) interface{} {
|
||||
|
@ -9,6 +9,7 @@ func Fixture16bit(t *testing.T) interface{} {
|
||||
return 65536
|
||||
}
|
||||
|
||||
/*
|
||||
func TestFixture(t *testing.T) {
|
||||
var f Ft = Fixture16bit
|
||||
var t Test {
|
||||
@ -16,3 +17,4 @@ func TestFixture(t *testing.T) {
|
||||
}
|
||||
t.RunWith(f,
|
||||
}
|
||||
*/
|
||||
|
@ -1,6 +1,8 @@
|
||||
// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
|
||||
|
||||
package fixtures
|
||||
|
||||
/*
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
@ -18,7 +20,6 @@ func (f *F) AddGetter(ft Getter) {
|
||||
append(f.func, ft)
|
||||
}
|
||||
|
||||
|
||||
type Ft func(t *testing.T) interface{}
|
||||
|
||||
func (f *Ft) Get(t *testing.T) {
|
||||
@ -37,3 +38,5 @@ type F struct {
|
||||
func (f *F) RunWith(t *testing.T, data interface{}) {
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
|
73
fixtures/fixtures.go.
Normal file
73
fixtures/fixtures.go.
Normal file
@ -0,0 +1,73 @@
|
||||
// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
|
||||
package fixtures
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
type Test func(t *testing.T)
|
||||
|
||||
// Read fixture data
|
||||
// RunWith test
|
||||
type FRunner interface {
|
||||
Read() interface{}
|
||||
RunWith(Test)
|
||||
}
|
||||
|
||||
type F struct {
|
||||
*testing.T
|
||||
Init *struct
|
||||
}
|
||||
|
||||
func New(i interface{}) *F {
|
||||
return &F{ t, Init: i }
|
||||
}
|
||||
|
||||
func (f *F) Read() interface{} {
|
||||
|
||||
}
|
||||
|
||||
func (f *F) RunWith(t Test) {
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Test(t *testing.T) {
|
||||
f = Fix{t}
|
||||
f.GetData
|
||||
for x in range(data) {
|
||||
f.RunWith(func
|
||||
t.Run(name, subtest)
|
||||
}
|
||||
}
|
||||
|
||||
Fixtures
|
||||
{ input, output },
|
||||
{ input1, output1 },
|
||||
|
||||
Fixture.RunWith(Test { })
|
||||
|
||||
|
||||
|
||||
|
||||
type Test func(t *testing.T)
|
||||
|
||||
type Fixture func(f *F) interface{}
|
||||
|
||||
func FixtureFoo() interface{} {
|
||||
os.Open(
|
||||
}
|
||||
|
||||
func TestWith() {
|
||||
|
||||
}
|
||||
|
||||
func (f Test) RunWith(t *testing.T, f []Fixture) {
|
||||
for d := range(f) {
|
||||
t.Run(name, f)
|
||||
// Run subtest
|
||||
t.Run()
|
||||
}
|
||||
|
||||
*/
|
@ -1,6 +1,8 @@
|
||||
// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
|
||||
|
||||
package fixtures
|
||||
|
||||
/*
|
||||
import (
|
||||
"testing"
|
||||
"io/ioutil"
|
||||
@ -39,3 +41,5 @@ func (f *F) FixtureTestData() {
|
||||
f.Run(f.Name() + "." + subtestname, func (t *testing.T) { f.RunWith(f.T, data) })
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
@ -1,6 +1,9 @@
|
||||
// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
|
||||
|
||||
|
||||
package fixtures
|
||||
|
||||
/*
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
@ -21,4 +24,4 @@ func (tf Test) RunWith(t *testing.T, f []Ft) {
|
||||
t.Run(t.Name() + strconv.Itoa(i), tf)
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
// "fmt"
|
||||
// "strings"
|
||||
// "strconv"
|
||||
"testing/fixture"
|
||||
"gitea.rosskeen.house/rosskeen.house/testing/fixture"
|
||||
)
|
||||
|
||||
// Raw file fixture data
|
||||
|
@ -4,8 +4,8 @@ package mockdata_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"testing/fixture"
|
||||
"testing/md"
|
||||
"gitea.rosskeen.house/rosskeen.house/testing/fixture"
|
||||
"gitea.rosskeen.house/rosskeen.house/testing/md"
|
||||
)
|
||||
|
||||
type MockDataTest struct {
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
"gopkg.in/yaml.v2"
|
||||
"log"
|
||||
"fmt"
|
||||
"testing/fixture"
|
||||
"gitea.rosskeen.house/rosskeen.house/testing/fixture"
|
||||
)
|
||||
|
||||
// Return a structure to load the mock data into
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"path/filepath"
|
||||
"log"
|
||||
"fmt"
|
||||
"testing/fixture"
|
||||
"gitea.rosskeen.house/rosskeen.house/testing/fixture"
|
||||
)
|
||||
|
||||
type Results struct {
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"path/filepath"
|
||||
"log"
|
||||
"fmt"
|
||||
"testing/fixture"
|
||||
"gitea.rosskeen.house/rosskeen.house/testing/fixture"
|
||||
)
|
||||
|
||||
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"path/filepath"
|
||||
"log"
|
||||
"fmt"
|
||||
"testing/fixture"
|
||||
"gitea.rosskeen.house/rosskeen.house/testing/fixture"
|
||||
)
|
||||
|
||||
type TypeConversion func(value interface{}) interface{}
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
// "fmt"
|
||||
// "strings"
|
||||
// "strconv"
|
||||
"testing/fixture"
|
||||
"gitea.rosskeen.house/rosskeen.house/testing/fixture"
|
||||
)
|
||||
|
||||
// Raw file fixture data
|
||||
|
@ -6,8 +6,8 @@ import (
|
||||
"testing"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing/fixture"
|
||||
"testing/td"
|
||||
"gitea.rosskeen.house/rosskeen.house/testing/fixture"
|
||||
"gitea.rosskeen.house/rosskeen.house/testing/td"
|
||||
)
|
||||
|
||||
func TestTDFixture(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user