menu-traversals #108

Closed
carlos wants to merge 72 commits from menu-traversals into master
3 changed files with 7 additions and 9 deletions
Showing only changes of commit 7d1db50294 - Show all commits

View File

@ -26,8 +26,8 @@ func TestEngine(sessionId string) (engine.Engine,*persist.Persister){
cfg := engine.Config{
Root: "root",
SessionId: sessionId,
OutputSize: uint32(106),
FlagCount: uint32(16),
OutputSize: uint32(160),
//FlagCount: uint32(16),
}
dbDir := ".test_state"

View File

@ -2,7 +2,6 @@ package main
import (
"bufio"
"bytes"
"context"
"encoding/json"
"fmt"
@ -30,8 +29,8 @@ type TestData struct {
}
func TestUserRegistration(t *testing.T) {
en, pe := enginetest.TestEngine("session1234112")
w := bytes.NewBuffer(nil)
en, pe := enginetest.TestEngine("session12341122")
//w := bytes.NewBuffer(nil)
file, err := os.Open("test_data.json")
if err != nil {
fmt.Println("Error opening file:", err)
@ -51,11 +50,9 @@ func TestUserRegistration(t *testing.T) {
inputBuilder.WriteString(strings.Join(testCase.Input, "\n") + "\n")
}
readers := bufio.NewReader(strings.NewReader(inputBuilder.String()))
engine.Loop(context.Background(), en, readers, w, nil)
engine.Loop(context.Background(), en, readers, os.Stdout, nil)
st := pe.GetState()
sym, _ := st.Where()
b := w.Bytes()
fmt.Println("Menu:",string(b))
fmt.Println("Rendering symbol:", sym)
}

View File

@ -1,8 +1,9 @@
{
"user_registration": [
{
"input": ["0", "0","1234","1234"],
"input": ["","0", "0","1234","1234"],
"expected": "Registration successful"
}
],
"pincheck": [