diff --git a/fixture/fixture_test.go b/fixture/fixture_test.go index 81730c4..e1c67bc 100644 --- a/fixture/fixture_test.go +++ b/fixture/fixture_test.go @@ -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{} { diff --git a/fixtures/fixture_test.go b/fixtures/fixture_test.go index 3627d52..ee6ceb0 100644 --- a/fixtures/fixture_test.go +++ b/fixtures/fixture_test.go @@ -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, } +*/ diff --git a/fixtures/fixtures.go b/fixtures/fixtures.go index c00cd05..e8b5c03 100644 --- a/fixtures/fixtures.go +++ b/fixtures/fixtures.go @@ -1,6 +1,8 @@ // Copyright 2024 Matthew Rich . 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{}) { } + +*/ diff --git a/fixtures/fixtures.go. b/fixtures/fixtures.go. new file mode 100644 index 0000000..d3d19e1 --- /dev/null +++ b/fixtures/fixtures.go. @@ -0,0 +1,73 @@ +// Copyright 2024 Matthew Rich . 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() +} + +*/ diff --git a/fixtures/testdata.go b/fixtures/testdata.go index 8d49e6e..a18e5da 100644 --- a/fixtures/testdata.go +++ b/fixtures/testdata.go @@ -1,6 +1,8 @@ // Copyright 2024 Matthew Rich . 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) }) } } + +*/ diff --git a/fixtures/tester.go b/fixtures/tester.go index be74d77..fd922be 100644 --- a/fixtures/tester.go +++ b/fixtures/tester.go @@ -1,6 +1,9 @@ // Copyright 2024 Matthew Rich . 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) } } - +*/ diff --git a/md/mockdata.go b/md/mockdata.go index 051b74e..d0fe0fa 100644 --- a/md/mockdata.go +++ b/md/mockdata.go @@ -10,7 +10,7 @@ import ( // "fmt" // "strings" // "strconv" - "testing/fixture" + "gitea.rosskeen.house/rosskeen.house/testing/fixture" ) // Raw file fixture data diff --git a/md/mockdata_test.go b/md/mockdata_test.go index 5b2edc1..c587254 100644 --- a/md/mockdata_test.go +++ b/md/mockdata_test.go @@ -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 { diff --git a/md/params.go b/md/params.go index 61454cc..dd14521 100644 --- a/md/params.go +++ b/md/params.go @@ -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 diff --git a/md/results.go b/md/results.go index a874f21..4868c8a 100644 --- a/md/results.go +++ b/md/results.go @@ -6,7 +6,7 @@ import ( "path/filepath" "log" "fmt" - "testing/fixture" + "gitea.rosskeen.house/rosskeen.house/testing/fixture" ) type Results struct { diff --git a/td/params.go b/td/params.go index a1944a3..73c9881 100644 --- a/td/params.go +++ b/td/params.go @@ -7,7 +7,7 @@ import ( "path/filepath" "log" "fmt" - "testing/fixture" + "gitea.rosskeen.house/rosskeen.house/testing/fixture" ) diff --git a/td/results.go b/td/results.go index 728c76b..57af207 100644 --- a/td/results.go +++ b/td/results.go @@ -6,7 +6,7 @@ import ( "path/filepath" "log" "fmt" - "testing/fixture" + "gitea.rosskeen.house/rosskeen.house/testing/fixture" ) type TypeConversion func(value interface{}) interface{} diff --git a/td/testdata.go b/td/testdata.go index 1ec6bfb..5c36d29 100644 --- a/td/testdata.go +++ b/td/testdata.go @@ -10,7 +10,7 @@ import ( // "fmt" // "strings" // "strconv" - "testing/fixture" + "gitea.rosskeen.house/rosskeen.house/testing/fixture" ) // Raw file fixture data diff --git a/td/testdata_test.go b/td/testdata_test.go index 0e9c688..b667474 100644 --- a/td/testdata_test.go +++ b/td/testdata_test.go @@ -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) {