diff --git a/transpile/service_test.go b/transpile/service_test.go index bc87d09..322f8d4 100644 --- a/transpile/service_test.go +++ b/transpile/service_test.go @@ -607,6 +607,41 @@ var _ = Describe("Go Translator", func() { ` Compare(source, expected) }) + It("Go создаёт поток - два раза", func() { + source := `package test + func main() { + go myfunction() + go myfunction2() + } + func myfunction() { + } + func myfunction2() { + } + ` + expected := ` + void main(); + void myfunction(); + void myfunction2(); + void __GoHelper_myfunction(void*) { + myfunction(); + vTaskDelete(NULL); + } + void __GoHelper_myfunction2(void*) { + myfunction2(); + vTaskDelete(NULL); + } + + void main() { + xTaskCreate(__GoHelper_myfunction,"",1024,NULL,1,NULL); + xTaskCreate(__GoHelper_myfunction2,"",1024,NULL,1,NULL); + } + void myfunction() { + } + void myfunction2() { + } + ` + Compare(source, expected) + }) }) Describe("Функции", func() {