update test

This commit is contained in:
Carlosokumu 2024-10-02 09:01:27 +03:00
parent 7c0ae80bbf
commit 6eec9571c7
Signed by: carlos
GPG Key ID: 7BD6BC8160A5C953

View File

@ -324,27 +324,19 @@ func TestMyAccount_Savefirstname(t *testing.T) {
for _, group := range groups { for _, group := range groups {
for index, step := range group.Steps { for index, step := range group.Steps {
t.Logf("step %v with input %v", index, step.Input) t.Logf("step %v with input %v", index, step.Input)
_, err := en.Exec(ctx, []byte(step.Input))
cont, err := en.Exec(ctx, []byte("3"))
if err != nil { if err != nil {
t.Errorf("Test case '%s' failed at input '%s': %v", group.Name, step.Input, err) t.Errorf("Test case '%s' failed at input '%s': %v", group.Name, step.Input, err)
return return
} }
if !cont {
break
}
w := bytes.NewBuffer(nil) w := bytes.NewBuffer(nil)
if _, err := en.Flush(ctx, w); err != nil { if _, err := en.Flush(ctx, w); err != nil {
t.Errorf("Test case '%s' failed during Flush: %v", group.Name, err) t.Errorf("Test case '%s' failed during Flush: %v", group.Name, err)
} }
b := w.Bytes() b := w.Bytes()
if !bytes.Equal(b, []byte(step.ExpectedContent)) { if !bytes.Equal(b, []byte(step.ExpectedContent)) {
t.Fatalf("expected:\n\t%s\ngot:\n\t%s\n", step.ExpectedContent, b) t.Fatalf("expected:\n\t%s\ngot:\n\t%s\n", step.ExpectedContent, b)
} }
en.Finish()
} }
} }