mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-22 09:37:09 +00:00
* Introduce Makefile and go vendor directory for faster build * WIP: Refactor cloud-game codebase with spliting overlord and worker binary * Fix all issues and have a running build * Complete first version of refactor
24 lines
429 B
Go
24 lines
429 B
Go
package storage
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"log"
|
|
"testing"
|
|
)
|
|
|
|
func TestSaveGame(t *testing.T) {
|
|
client := NewInitClient()
|
|
data := []byte("Test Hello")
|
|
ioutil.WriteFile("/tmp/TempFile", data, 0644)
|
|
err := client.SaveFile("Test", "/tmp/TempFile")
|
|
if err != nil {
|
|
log.Panic(err)
|
|
}
|
|
loadData, err := client.LoadFile("Test")
|
|
if err != nil {
|
|
log.Panic(err)
|
|
}
|
|
if string(data) != string(loadData) {
|
|
log.Panic("Failed")
|
|
}
|
|
}
|