Поправлены тесты: Setup/Loop - void типа
Этот коммит содержится в:
родитель
f148905b04
коммит
dc70a8b3cf
1 изменённых файлов: 20 добавлений и 20 удалений
|
@ -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 <WiFi.h>
|
||||
|
@ -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;
|
||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче