-
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.
Browse files
Browse the repository at this point in the history
* add item version * make prefix/suffixes a fixed length array * add simple unit test
- Loading branch information
Showing
4 changed files
with
55 additions
and
11 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
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,33 @@ | ||
package d2s | ||
|
||
import ( | ||
"log" | ||
"os" | ||
"testing" | ||
) | ||
|
||
/** | ||
* Parse NokkaSorc.d2s from examples and verify the chars name | ||
**/ | ||
func TestParse(t *testing.T) { | ||
path := "examples/NokkaSorc.d2s" | ||
file, err := os.Open(path) | ||
if err != nil { | ||
log.Fatal("Error while opening .d2s file", err) | ||
} | ||
|
||
defer file.Close() | ||
|
||
char, err := Parse(file) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
if char.Header.Name.String() != "NokkaSorc" { | ||
t.Errorf("Expected char name to be %v. Got %v", "NokkaSorc", char.Header.Name) | ||
} | ||
|
||
//Write out the data to console. | ||
//charJSON, err := json.MarshalIndent(char, "", " ") | ||
//fmt.Printf("%s", string(charJSON)) | ||
} |
Binary file not shown.
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