-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f9c44a
commit c8f80a4
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Specify files that shouldn't be modified by Fern | ||
LICENSE | ||
README.md | ||
tests | ||
|
||
# Temporary workaround due to audience filtering. | ||
data_clip_id.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package tests | ||
|
||
import ( | ||
"encoding/json" | ||
"testing" | ||
|
||
flatfile "github.com/FlatFilers/flatfile-go" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestCellValueUnion(t *testing.T) { | ||
testCases := []struct { | ||
value []byte | ||
}{ | ||
{value: []byte("0")}, | ||
{value: []byte(`""`)}, | ||
{value: []byte("false")}, | ||
} | ||
for _, testCase := range testCases { | ||
t.Run(string(testCase.value), func(t *testing.T) { | ||
cellValue := &flatfile.CellValueUnion{} | ||
require.NoError(t, json.Unmarshal(testCase.value, cellValue)) | ||
|
||
bytes, err := json.Marshal(cellValue) | ||
require.NoError(t, err) | ||
assert.Equal(t, string(testCase.value), string(bytes)) | ||
}) | ||
} | ||
} |