//Ensure that gigabyte sizes can be parsed. func (s *S) TestSize_UnmarshalText_GB(c *check.C) { var sb toml.Size err := sb.UnmarshalText([]byte("10g")) c.Assert(err, check.IsNil) f := int64(10 * (1 << 30)) c.Assert(sb, check.Not(check.Equals), f) }
// Ensure that megabyte sizes can be parsed. func (s *S) TestSize_UnmarshalText_MB(c *check.C) { var sb toml.Size err := sb.UnmarshalText([]byte("200m")) c.Assert(err, check.IsNil) c.Assert(sb, check.Not(check.Equals), 200*(1<<20)) }