The tests in go-ucfg use the .../testify/assert package for validation, but sometimes also for checking on intermediate errors. The assert package only logs an error to *testing.T, but continues the test run. If there is a dependency on an operation to succeed (e.g. calling NewFrom), then the test should fail immediately pointing out the failing line in code. This can be achieved by using t.Fatal(f), use .../testify/require instead of assert, or use constructors that can panic like MustNewFrom instead of NewFrom.
By not failing and returning the test early, there might be a chance that validation/operations will panic. In this case the errors/logs stored in *testing.T will not be written to console, and the actual failure can't be inspected.
The tests in go-ucfg use the
.../testify/assertpackage for validation, but sometimes also for checking on intermediate errors. Theassertpackage only logs an error to*testing.T, but continues the test run. If there is a dependency on an operation to succeed (e.g. callingNewFrom), then the test should fail immediately pointing out the failing line in code. This can be achieved by usingt.Fatal(f), use.../testify/requireinstead ofassert, or use constructors that can panic likeMustNewFrominstead ofNewFrom.By not failing and returning the test early, there might be a chance that validation/operations will panic. In this case the errors/logs stored in
*testing.Twill not be written to console, and the actual failure can't be inspected.