You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I'd like to describe used in a project tests template.
each _test.go file should look as follows:
testdata() map[*TestedType]binaryFormat method.
this method should specify as much, as possible/necessary test cases in described map form
Test_Load(t *testing.T) this method is really easy
// declare testdatatd:=testdata()
// testing loopforkey, value:=rangetd {
// load tested structure using data (value) given// in some cases, it could be necessary to create bitmuncher (datautils.CreateBitMuncher(value, 0) ) and pass it as an argument to loads:=New()
s.Load(value)
// then just use `assert` to check resultsassert.Equal(t, key, s, "unexpected structure loaded")
}
Test_Encode(t *testing.T) is also really simple
td:=testdata()
forkey, value:=rangetd {
// encode tested structure into binary form (value)data:=key.Encode()
// use assert to detect differencesassert.Equal(t, value, data, "unexpected data encoded")
}
The text was updated successfully, but these errors were encountered:
Hi there, I'd like to describe used in a project tests template.
each
_test.go
file should look as follows:testdata() map[*TestedType]binaryFormat
method.this method should specify as much, as possible/necessary test cases in described map form
Test_Load(t *testing.T)
this method is really easyTest_Encode(t *testing.T)
is also really simpleThe text was updated successfully, but these errors were encountered: