Commit Graph

20 Commits

Author SHA1 Message Date
Dave Collins e0d93cdf8b Update imports for previous. 2013-11-14 21:46:27 -06:00
Dave Collins fab1d2b55f Move TestSortValues to common_test.go.
This commit moves the TestSortValues function from dump_test.go to
common_test.go to mirror the new implementation location.  It also
slightly formats the tests to be consistent with the rest of the package.
2013-11-14 21:44:13 -06:00
Patrick Mezard 1fdf49f1b9 config: add SortKeys option to sort native map keys before display
If ConfigState.SortKeys is true, then dump and format will sort map keys
before displaying them. Only native types (bool, ints, uint, uintptr,
string) are supported, other slices are left unchanged.

The motivation is to have more diffable output, mostly for test purpose.
2013-10-27 23:44:49 +01:00
Dave Collins 56a83c905e Add tests for recent cgo handling updates.
This commit adds tests for the recent cgo handling of char, unsigned char,
and uint8_t arrays.

In addition, it adds an architecture for the cgo specific testing based on
build constraints.  This was done because spew itself does not require
cgo, but in order to test its handling of the cgo types it needs to be fed
cgo data.  Rather than force all users to have a system which supports cgo
and an external compiler just to run the tests, the cgo test support must
explicitly be turned on via a build tag.
2013-09-21 21:50:00 -05:00
Dave Collins 8f603f64f9 Add tests for nil slice change.
This commit adds tests for the nil slice change.
2013-09-09 20:43:39 -05:00
Dave Collins 3bcb0679af Add tests for packed nil interfaces.
This commit adds tests for nil interfaces packed inside maps and slices to
test the recently added fix for issue #12.
2013-03-27 22:50:10 -05:00
Dave Collins 8fb5bf1e06 Add tests for byte arrays and slices.
This commit adds tests for the new byte array and slice hexdump
functionality as specified in issue #9.
2013-03-08 22:21:05 -06:00
Dave Collins f2641d5e6e Add tests for structs with multiple equiv fields.
This commit adds tests for a struct which has an embedded struct pointer
and a field that is a pointer to the same object.  This ensures the cycle
detection is properly reset between fields.
2013-01-20 19:55:55 -06:00
Dave Collins 3ad8c5b5ee Add tests for sub-interfaces. 2013-01-20 15:27:57 -06:00
Dave Collins 89496a6569 Add tests for types with custom Error interface. 2013-01-20 13:41:53 -06:00
Dave Collins 57a610269f Abstract common test types and functions. 2013-01-20 13:31:01 -06:00
Dave Collins ad1d81b355 Add tests for custom type that panics in Stringer. 2013-01-20 12:31:42 -06:00
Dave Collins 5c8d842977 Add tests for maps with multiple entries.
Previously, the tests did not include maps with more than a single entry
since the iteration order is randomized and the tests only accepted a
single valid expected value.  This commit modifies the tests to accept
multiple valid expected values and adds tests for a multi-entry map to
both Dump and Formatter.
2013-01-20 12:02:36 -06:00
Dave Collins e48df78db8 Update test summaries. 2013-01-17 21:40:54 -06:00
Dave Collins 9df67c91eb Add dump tests for interface arrays and slices. 2013-01-17 21:35:19 -06:00
Dave Collins c5fba05307 Fix a comment and a apply few gofmt changes. 2013-01-16 23:30:06 -06:00
Dave Collins 73b25df0f5 Namespace dump tests. 2013-01-14 08:53:38 -06:00
Dave Collins e892c84d38 Add tests for non-interface nil pointers.
These tests are a slight adaptation of tests provided by
kortschak@ in issue #4.  Credits go to him.
2013-01-12 23:36:46 -06:00
Dave Collins a2ceabae67 Minor code cleanup in dump_test.go. 2013-01-12 23:24:56 -06:00
Dave Collins 1a599b7b25 Initial implementation. 2013-01-08 23:38:16 -06:00