Fix compare of uints and ints in eq, gt etc.

Fixes #12733
This commit is contained in:
Bjørn Erik Pedersen
2024-08-09 17:54:14 +02:00
parent ef2e30eca3
commit fbfccb394b
3 changed files with 62 additions and 3 deletions

View File

@@ -34,3 +34,19 @@ W/H rotated: {{ $rotated.Width }}/{{ $rotated.Height }}
b := hugolib.Test(t, files)
b.AssertFileContent("public/index.html", "W/H original: 80/40\n\nW/H rotated: 40/80")
}
// Issue 12733.
func TestOrientationEq(t *testing.T) {
files := `
-- hugo.toml --
-- assets/rotate270.jpg --
sourcefilename: ../testdata/exif/orientation6.jpg
-- layouts/index.html --
{{ $img := resources.Get "rotate270.jpg" }}
{{ $orientation := $img.Exif.Tags.Orientation }}
Orientation: {{ $orientation }}|eq 6: {{ eq $orientation 6 }}|Type: {{ printf "%T" $orientation }}|
`
b := hugolib.Test(t, files)
b.AssertFileContent("public/index.html", "Orientation: 6|eq 6: true|")
}