"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "minifiers/minifiers_test.go" between
hugo-0.80.0.tar.gz and hugo-0.81.0.tar.gz

About: Hugo is a static site generator that takes a source directory of Markdown files and templates and uses these as input to create a complete website (written in Go).

minifiers_test.go  (hugo-0.80.0):minifiers_test.go  (hugo-0.81.0)
skipping to change at line 37 skipping to change at line 37
) )
func TestNew(t *testing.T) { func TestNew(t *testing.T) {
c := qt.New(t) c := qt.New(t)
v := viper.New() v := viper.New()
m, _ := New(media.DefaultTypes, output.DefaultFormats, v) m, _ := New(media.DefaultTypes, output.DefaultFormats, v)
var rawJS string var rawJS string
var minJS string var minJS string
rawJS = " var foo =1 ; foo ++ ; " rawJS = " var foo =1 ; foo ++ ; "
minJS = "var foo=1;foo++;" minJS = "var foo=1;foo++"
var rawJSON string var rawJSON string
var minJSON string var minJSON string
rawJSON = " { \"a\" : 123 , \"b\":2, \"c\": 5 } " rawJSON = " { \"a\" : 123 , \"b\":2, \"c\": 5 } "
minJSON = "{\"a\":123,\"b\":2,\"c\":5}" minJSON = "{\"a\":123,\"b\":2,\"c\":5}"
for _, test := range []struct { for _, test := range []struct {
tp media.Type tp media.Type
rawString string rawString string
expectedMinString string expectedMinString string
skipping to change at line 168 skipping to change at line 168
}{ }{
// https://github.com/gohugoio/hugo/issues/5506 // https://github.com/gohugoio/hugo/issues/5506
{media.CSSType, " body { color: rgba(000, 000, 000, 0.7); }", "bo dy{color:rgba(0,0,0,.7)}"}, {media.CSSType, " body { color: rgba(000, 000, 000, 0.7); }", "bo dy{color:rgba(0,0,0,.7)}"},
} { } {
var b bytes.Buffer var b bytes.Buffer
c.Assert(m.Minify(test.tp, &b, strings.NewReader(test.rawString)) , qt.IsNil) c.Assert(m.Minify(test.tp, &b, strings.NewReader(test.rawString)) , qt.IsNil)
c.Assert(b.String(), qt.Equals, test.expectedMinString) c.Assert(b.String(), qt.Equals, test.expectedMinString)
} }
} }
// Renamed to Precision in v2.7.0. Check that we support both.
func TestDecodeConfigDecimalIsNowPrecision(t *testing.T) {
c := qt.New(t)
v := viper.New()
v.Set("minify", map[string]interface{}{
"disablexml": true,
"tdewolff": map[string]interface{}{
"css": map[string]interface{}{
"decimal": 3,
},
"svg": map[string]interface{}{
"decimal": 3,
},
},
})
conf, err := decodeConfig(v)
c.Assert(err, qt.IsNil)
c.Assert(conf.Tdewolff.CSS.Precision, qt.Equals, 3)
}
 End of changes. 2 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)