From 2afb31fd415dc1e48cdcc0525538309abec5e075 Mon Sep 17 00:00:00 2001 From: andygeiss <4ndygeiss@gmail.com> Date: Wed, 19 Dec 2018 19:28:33 +0100 Subject: [PATCH] modules added --- go.mod | 3 +++ go.sum | 2 ++ impl/transpile/transpile_test.go | 6 ++++-- impl/worker/worker_test.go | 10 +++++----- 4 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 go.mod create mode 100644 go.sum diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..feca967 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/andygeiss/esp32-transpiler + +require github.com/andygeiss/assert v0.0.3 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..9517c99 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/andygeiss/assert v0.0.3 h1:PgY7eH+UaCvOzScsX3HGqNfCemkvpcNHQjwT2Dyq0sw= +github.com/andygeiss/assert v0.0.3/go.mod h1:ztUvWrfUo43X0zMA1XfX8esn5Uavk6ANSKTT0w2qvAI= diff --git a/impl/transpile/transpile_test.go b/impl/transpile/transpile_test.go index 88c3bb9..8015f3e 100644 --- a/impl/transpile/transpile_test.go +++ b/impl/transpile/transpile_test.go @@ -2,7 +2,8 @@ package transpile_test import ( "bytes" - . "github.com/andygeiss/assert" + "github.com/andygeiss/assert" + "github.com/andygeiss/assert/is" "github.com/andygeiss/esp32-transpiler/api/worker" "github.com/andygeiss/esp32-transpiler/impl/transpile" "io" @@ -30,5 +31,6 @@ func TestTranspileErrorShouldBeNil(t *testing.T) { var in, out bytes.Buffer worker := &mockupWorker{&in, &out} trans := transpile.NewTranspiler(worker) - Assert(t, trans.Transpile(), IsNil()) + err := trans.Transpile() + assert.That(t, err, is.Equal(nil)) } diff --git a/impl/worker/worker_test.go b/impl/worker/worker_test.go index 311b621..75ed639 100644 --- a/impl/worker/worker_test.go +++ b/impl/worker/worker_test.go @@ -2,7 +2,8 @@ package worker_test import ( "bytes" - . "github.com/andygeiss/assert" + "github.com/andygeiss/assert" + "github.com/andygeiss/assert/is" "github.com/andygeiss/esp32-transpiler/impl/worker" "strings" "testing" @@ -23,10 +24,10 @@ func Validate(source, expected string, t *testing.T) { var in, out bytes.Buffer in.WriteString(source) wrk := worker.NewWorker(&in, &out, worker.NewMapping()) - Assert(t, wrk.Start(), IsNil()) + assert.That(t, wrk.Start(), is.Equal(nil)) code := out.String() tcode, texpected := Trim(code), Trim(expected) - Assert(t, tcode, IsEqual(texpected)) + assert.That(t, tcode, is.Equal(texpected)) } func Test_Empty_Package(t *testing.T) { @@ -66,7 +67,6 @@ func Test_Const_String_Declaration(t *testing.T) { Validate(source, expected, t) } - func Test_Var_String_Declaration(t *testing.T) { source := `package test var client wifi.Client @@ -476,4 +476,4 @@ func Test_WiFiWebClient(t *testing.T) { } }` Validate(source, expected, t) -} \ No newline at end of file +}