2023-10-24 18:03:04 +03:00
|
|
|
package create_files
|
|
|
|
|
2024-11-21 16:04:41 +03:00
|
|
|
import (
|
|
|
|
"github.com/gobeam/stringy"
|
|
|
|
"testing"
|
|
|
|
)
|
2023-10-24 18:03:04 +03:00
|
|
|
|
|
|
|
func TestFindSingularName(t *testing.T) {
|
2024-09-06 15:10:00 +03:00
|
|
|
Otvet := Find_SingularName("lawsuit_status_types")
|
2023-10-24 18:03:04 +03:00
|
|
|
if Otvet == "" {
|
|
|
|
t.Error("TestFindSingularName() error: Otvet =''")
|
|
|
|
}
|
|
|
|
}
|
2023-10-27 11:43:15 +03:00
|
|
|
|
|
|
|
func TestFormatName(t *testing.T) {
|
2024-11-21 16:04:41 +03:00
|
|
|
Name := "first_1min_candle_date"
|
2023-10-27 11:43:15 +03:00
|
|
|
Otvet := FormatName(Name)
|
|
|
|
if Otvet == "" {
|
|
|
|
t.Error("TestFormatName() error")
|
|
|
|
}
|
|
|
|
}
|
2023-11-02 15:57:13 +03:00
|
|
|
|
|
|
|
func TestDeleteLineWithComment(t *testing.T) {
|
|
|
|
s := `import (
|
2023-12-27 14:28:11 +03:00
|
|
|
"github.com/ManyakRus/starter/config_main"
|
2023-11-10 13:28:58 +03:00
|
|
|
"github.com/ManyakRus/starter/postgres_gorm"
|
2023-11-02 15:57:13 +03: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 = ''")
|
|
|
|
}
|
|
|
|
}
|
2024-11-21 16:04:41 +03:00
|
|
|
|
|
|
|
func TestPascalCase(t *testing.T) {
|
|
|
|
Name := "first_1min_candle_date"
|
|
|
|
str := stringy.New(Name)
|
|
|
|
Otvet := str.PascalCase("1m", "1M").Get()
|
|
|
|
if Otvet == "" {
|
|
|
|
t.Error("TestFormatName() error")
|
|
|
|
}
|
|
|
|
}
|