aboutsummaryrefslogtreecommitdiff
path: root/pkg/field/utils_test.go
diff options
context:
space:
mode:
authorJulien Dessaux2021-09-20 01:22:18 +0200
committerJulien Dessaux2021-09-20 01:22:18 +0200
commitae7f4d5acfe2ab97bd51523aed24b6f6aa74523e (patch)
tree7f8cded5121abcf0ea61ce2ffbae9019f730b041 /pkg/field/utils_test.go
parentImplemented function to set a field value (diff)
downloadgofunge98-ae7f4d5acfe2ab97bd51523aed24b6f6aa74523e.tar.gz
gofunge98-ae7f4d5acfe2ab97bd51523aed24b6f6aa74523e.tar.bz2
gofunge98-ae7f4d5acfe2ab97bd51523aed24b6f6aa74523e.zip
Refactoring
Diffstat (limited to '')
-rw-r--r--pkg/field/utils_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/field/utils_test.go b/pkg/field/utils_test.go
index 52916e3..59a7cee 100644
--- a/pkg/field/utils_test.go
+++ b/pkg/field/utils_test.go
@@ -32,7 +32,7 @@ func TestGet(t *testing.T) {
file, err := os.Open(tc.input)
require.NoError(t, err, "Failed to open file")
defer file.Close()
- field, err := LoadFile(file)
+ field, err := Load(file)
valid := field.Get(tc.inputX, tc.inputY)
require.NoError(t, err)
require.Equal(t, tc.expected, valid, "Invalid value")
@@ -65,7 +65,7 @@ func TestIsIn(t *testing.T) {
file, err := os.Open(tc.input)
require.NoError(t, err, "Failed to open file")
defer file.Close()
- field, err := LoadFile(file)
+ field, err := Load(file)
valid := field.isIn(tc.inputX, tc.inputY)
require.NoError(t, err)
require.Equal(t, tc.expected, valid, "Invalid value")
@@ -141,7 +141,7 @@ func TestSetMinimalAppendOne(t *testing.T) {
file, err := os.Open(tc.input)
require.NoError(t, err, "Failed to open file")
defer file.Close()
- field, err := LoadFile(file)
+ field, err := Load(file)
field.Set(tc.inputX, tc.inputY, tc.inputV)
require.NoError(t, err)
require.Equal(t, tc.expected, field, "Invalid value")
@@ -217,7 +217,7 @@ func TestSetMinimalAppendTwo(t *testing.T) {
file, err := os.Open(tc.input)
require.NoError(t, err, "Failed to open file")
defer file.Close()
- field, err := LoadFile(file)
+ field, err := Load(file)
field.Set(tc.inputX, tc.inputY, tc.inputV)
require.NoError(t, err)
require.Equal(t, tc.expected, field, "Invalid value")
@@ -287,7 +287,7 @@ func TestSetMinimalAppendThree(t *testing.T) {
file, err := os.Open(tc.input)
require.NoError(t, err, "Failed to open file")
defer file.Close()
- field, err := LoadFile(file)
+ field, err := Load(file)
field.Set(tc.inputX, tc.inputY, tc.inputV)
require.NoError(t, err)
require.Equal(t, tc.expected, field, "Invalid value")
@@ -316,7 +316,7 @@ func TestGetAndSetOnEmptyLines(t *testing.T) {
file, err := os.Open("test_data/minimal.b98")
require.NoError(t, err, "Failed to open file")
defer file.Close()
- field, err := LoadFile(file)
+ field, err := Load(file)
field.Set(0, 3, '#')
v := field.Get(0, 3)
require.Equal(t, v, int('#'))