add_balance

This commit is contained in:
Radu Ioan Fericean
2014-04-17 16:59:17 +03:00
parent 5f4580947a
commit 2da2294c0f
4 changed files with 99 additions and 6 deletions

View File

@@ -47,9 +47,17 @@ func TestToJSONEmpty(t *testing.T) {
}
func TestFromJSON(t *testing.T) {
line := FromJSON([]byte(`{"TimeStart":"Test","Crazy":1,"Mama":true,"Test":1}`))
line := FromJSON([]byte(`{"TimeStart":"Test","Crazy":1,"Mama":true,"Test":1}`), []string{"TimeStart", "Test", "Crazy", "Mama", "Test"})
expected := `TimeStart="Test" Crazy=1 Mama=true Test=1`
if line != expected {
t.Errorf("Expected: %s got: '%s'", expected, line)
}
}
func TestFromJSONInterestingFields(t *testing.T) {
line := FromJSON([]byte(`{"TimeStart":"Test","Crazy":1,"Mama":true,"Test":1}`), []string{"TimeStart", "Test"})
expected := `TimeStart="Test" Test=1`
if line != expected {
t.Errorf("Expected: %s got: '%s'", expected, line)
}
}