init elowdb go-port commit
This commit is contained in:
30
tests/main_test.go
Normal file
30
tests/main_test.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
// Настройка перед тестами
|
||||
setup()
|
||||
|
||||
// Запуск тестов
|
||||
code := m.Run()
|
||||
|
||||
// Очистка после тестов
|
||||
teardown()
|
||||
|
||||
// Выход с кодом
|
||||
os.Exit(code)
|
||||
}
|
||||
|
||||
func setup() {
|
||||
// Создаем тестовые директории
|
||||
os.MkdirAll("./testdata", 0755)
|
||||
}
|
||||
|
||||
func teardown() {
|
||||
// Очищаем тестовые данные
|
||||
os.RemoveAll("./testdata")
|
||||
}
|
||||
Reference in New Issue
Block a user