aboutsummaryrefslogtreecommitdiff
path: root/pkg/client/state_test.go
diff options
context:
space:
mode:
authorJulien Dessaux2021-11-17 10:13:06 +0100
committerJulien Dessaux2021-11-17 10:13:06 +0100
commitc3263c03776401ad1263a9fb8f5a44a8ed44d61b (patch)
tree7dac91753cb4428ede2ba72fb09eca9ba6c2daab /pkg/client/state_test.go
parentUpdated dependencies (diff)
downloadshell-game-launcher-c3263c03776401ad1263a9fb8f5a44a8ed44d61b.tar.gz
shell-game-launcher-c3263c03776401ad1263a9fb8f5a44a8ed44d61b.tar.bz2
shell-game-launcher-c3263c03776401ad1263a9fb8f5a44a8ed44d61b.zip
Refactored package structure
Diffstat (limited to 'pkg/client/state_test.go')
-rw-r--r--pkg/client/state_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/client/state_test.go b/pkg/client/state_test.go
new file mode 100644
index 0000000..917c211
--- /dev/null
+++ b/pkg/client/state_test.go
@@ -0,0 +1,14 @@
+package client
+
+import "testing"
+
+func TestNewState(t *testing.T) {
+ // Empty login
+ if s := NewState(nil, ""); s.currentMenu != "anonymous" {
+ t.Fatal("a new state without login should init to anonymous")
+ }
+ // logged_in
+ if s := NewState(nil, "test"); s.currentMenu != "logged_in" {
+ t.Fatal("a new state with login should init to logged_in")
+ }
+}