Commit Graph

5 Commits

Author SHA1 Message Date
Dave Collins 65ca732a33 Add logic to deal with reflect pkg changes on tip.
This commit adds logic to gracefully handle the new internal reflect.Value
structure on tip as of golang commit ecccf07e7f9d.  It accomplishes this
by doing some inspection at init time and choosing the appropriate offsets
as well as modifying which offset is used for the value accordingly.  As a
result, this allows spew to work properly with both the current release
version of Go as well as tip.

Fixes #15.
2014-01-08 02:01:15 -06:00
Dave Collins de6d1a24a0 Reorganize the new map key sorting functionality.
This commit moves the new code related to sorting reflect.Value items into
common.go since it is accessed by both the formatter and the dumper.  It
also adds comments to the new functions and unexports SortValues since it
should be an internal function only.
2013-11-14 21:39:21 -06:00
Dave Collins 2fc049e83c Add tests for unrecognized reflect values.
In order to help future proof itself, spew handles unrecognized reflect
values by passing them on to the standard fmt library.  Since spew handles
all current reflect values in the language, this condition has to be
manually tested with a bit of hackery by using unsafe to change the kind
to a nonexistent value.

As of this commit, there is now 100% test coverage.
2013-01-20 22:31:09 -06:00
Dave Collins 3b5249e43e Consolidate tests for invalid reflect values. 2013-01-20 22:24:52 -06:00
Dave Collins 23b797ffdf Add tests for invalid reflect values. 2013-01-20 20:48:14 -06:00