From dc70a8b3cfafbece112922e1a389fb163d285372 Mon Sep 17 00:00:00 2001 From: Softonik Date: Mon, 4 Oct 2021 01:31:37 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D1=82=D0=B5=D1=81=D1=82=D1=8B:=20Setup/Lo?= =?UTF-8?q?op=20-=20void=20=D1=82=D0=B8=D0=BF=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- transpile/service_test.go | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/transpile/service_test.go b/transpile/service_test.go index c1292e8..8d34ac4 100644 --- a/transpile/service_test.go +++ b/transpile/service_test.go @@ -275,8 +275,8 @@ func Test_Package_Import_But_Ignore_Controller(t *testing.T) { func Test_IfStmt_With_Condition_BasicLit_And_BasicLit(t *testing.T) { source := `package test - func Setup() error {} - func Loop() error { + func Setup() {} + func Loop() { if 1 == 1 { serial.Println("1") } @@ -295,8 +295,8 @@ func Test_IfStmt_With_Condition_BasicLit_And_BasicLit(t *testing.T) { func Test_IfStmt_With_Condition_Ident_And_BasicLit(t *testing.T) { source := `package test - func Setup() error {} - func Loop() error { + func Setup() {} + func Loop() { if x == 1 { serial.Println("1") } @@ -315,8 +315,8 @@ func Test_IfStmt_With_Condition_Ident_And_BasicLit(t *testing.T) { func Test_IfStmt_With_Condition_CallExpr_And_BasicLit(t *testing.T) { source := `package test - func Setup() error {} - func Loop() error { + func Setup() {} + func Loop() { if x() == 1 { serial.Println("1") } @@ -336,8 +336,8 @@ func Test_IfStmt_With_Condition_CallExpr_And_BasicLit(t *testing.T) { func Test_IfStmt_With_Condition_Const_And_BasicLit(t *testing.T) { source := `package test const maxX = 1 - func Setup() error {} - func Loop() error { + func Setup() {} + func Loop() { if x == maxX { serial.Println("1") } @@ -358,8 +358,8 @@ func Test_IfStmt_With_Condition_Const_And_BasicLit(t *testing.T) { func Test_IfStmt_With_Else(t *testing.T) { source := `package test const maxX = 1 - func Setup() error {} - func Loop() error { + func Setup() {} + func Loop() { if x == maxX { serial.Println("1") } else { @@ -383,8 +383,8 @@ func Test_IfStmt_With_Else(t *testing.T) { func Test_SwitchStmt_With_Ident_And_BasicLit(t *testing.T) { source := `package test - func Setup() error {} - func Loop() error { + func Setup() {} + func Loop() { switch x { case 1: serial.Println("1") @@ -405,8 +405,8 @@ func Test_SwitchStmt_With_Ident_And_BasicLit(t *testing.T) { func Test_SwitchStmt_With_Break(t *testing.T) { source := `package test - func Setup() error {} - func Loop() error { + func Setup() {} + func Loop() { switch x { case 1: serial.Println("1") @@ -434,7 +434,7 @@ func Test_SwitchStmt_With_Break(t *testing.T) { func Test_ForLoop_WithoutInit_And_Post_Transpiles_To_While(t *testing.T) { source := `package test import wifi "github.com/andygeiss/esp32/api/controller/wifi" - func Setup() error { + func Setup() { serial.Begin(serial.BaudRate115200) wifi.BeginEncrypted("SSID", "PASS") for wifi.Status() != wifi.StatusConnected { @@ -443,7 +443,7 @@ func Test_ForLoop_WithoutInit_And_Post_Transpiles_To_While(t *testing.T) { serial.Println("Connected!") return nil } - func Loop() error {} + func Loop() {} ` expected := ` #include @@ -464,8 +464,8 @@ func Test_WiFiWebClient(t *testing.T) { source := `package test import wifi "github.com/andygeiss/esp32/api/controller/wifi" var client wifi.Client - func Setup() error {} - func Loop() error { + func Setup() {} + func Loop() { serial.Print("Connecting to ") serial.Println(host) serial.Print(" ...") @@ -530,8 +530,8 @@ var _ = Describe("Go Translator", func() { It("Maps constants", func() { source := `package test var analogInPin int = arduino.A0 - func Setup() error {} - func Loop() error {} + func Setup() {} + func Loop() {} ` expected := ` int analogInPin = A0;