1
0
mirror of https://github.com/ManyakRus/crud_generator.git synced 2024-12-20 12:30:52 +02:00
crud_generator/internal/create_files/create_files_test.go

43 lines
995 B
Go
Raw Normal View History

2023-10-24 17:03:04 +02:00
package create_files
import "testing"
func TestFindSingularName(t *testing.T) {
Otvet := FindSingularName("lawsuit_status_types")
if Otvet == "" {
t.Error("TestFindSingularName() error: Otvet =''")
}
}
2023-10-27 10:43:15 +02:00
func TestFormatName(t *testing.T) {
2023-11-02 14:57:13 +02:00
Name := "document_invoice_id"
2023-10-27 10:43:15 +02:00
Otvet := FormatName(Name)
if Otvet == "" {
t.Error("TestFormatName() error")
}
}
2023-11-02 14:57:13 +02:00
func TestDeleteLineWithComment(t *testing.T) {
s := `import (
"github.com/ManyakRus/starter/config"
"github.com/ManyakRus/starter/postgres_gorm"
2023-11-02 14:57:13 +02:00
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types"
"testing"
//TestFind_ByExtID() "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/constants"
)
`
Otvet := DeleteLineWithComment(s, "TestFind_ByExtID")
if Otvet == "" {
t.Error("TestFormatName() error")
}
}
func TestPrintableString(t *testing.T) {
s := `123 // \\ 456
789`
Otvet := PrintableString(s)
if Otvet == "" {
t.Error("TestPrintableString() error: Otvet = ''")
}
}