From 689f84213f711c253e852d59e1ffedca75b7b07c Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Tue, 11 Feb 2025 15:45:38 +1100 Subject: [PATCH] lib: fix "go test" example names --- lib/litonlylzma/example_test.go | 4 ++-- lib/lowleveljpeg/example_basic_test.go | 4 ++-- lib/lowleveljpeg/example_ycbcr444_test.go | 4 ++-- lib/lowleveljpeg/lowleveljpeg.go | 2 +- lib/zlibcut/example_test.go | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/litonlylzma/example_test.go b/lib/litonlylzma/example_test.go index e421450d..4456309f 100644 --- a/lib/litonlylzma/example_test.go +++ b/lib/litonlylzma/example_test.go @@ -17,7 +17,7 @@ import ( "github.com/google/wuffs/lib/litonlylzma" ) -func ExampleRoundTripLZMA() { +func Example_roundTripLZMA() { original := []byte("Hello world.\n") compressed, err := litonlylzma.FileFormatLZMA.Encode(nil, original) if err != nil { @@ -45,7 +45,7 @@ func ExampleRoundTripLZMA() { // Hello world. } -func ExampleRoundTripXz() { +func Example_roundTripXz() { original := []byte("Hello world.\n") compressed, err := litonlylzma.FileFormatXz.Encode(nil, original) if err != nil { diff --git a/lib/lowleveljpeg/example_basic_test.go b/lib/lowleveljpeg/example_basic_test.go index 098830b8..e8c5c2e1 100644 --- a/lib/lowleveljpeg/example_basic_test.go +++ b/lib/lowleveljpeg/example_basic_test.go @@ -21,10 +21,10 @@ import ( "github.com/google/wuffs/lib/lowleveljpeg" ) -// Example_Basic demonstrates creating an opaque RGBA image and saving it as a +// Example_basic demonstrates creating an opaque RGBA image and saving it as a // JPEG. It uses 4:2:0 chroma subsampling, the most popular choice for colorful // (not gray) JPEG images. -func Example_Basic() { +func Example_basic() { const width, height = 40, 30 src := image.NewRGBA(image.Rect(0, 0, width, height)) diff --git a/lib/lowleveljpeg/example_ycbcr444_test.go b/lib/lowleveljpeg/example_ycbcr444_test.go index 303db284..eef06159 100644 --- a/lib/lowleveljpeg/example_ycbcr444_test.go +++ b/lib/lowleveljpeg/example_ycbcr444_test.go @@ -21,10 +21,10 @@ import ( "github.com/google/wuffs/lib/lowleveljpeg" ) -// Example_YCbCr444 demonstrates loading an RGB PNG, converting to YCbCr and to +// Example_yCbCr444 demonstrates loading an RGB PNG, converting to YCbCr and to // DCT space and saving as a 4:4:4 JPEG. Multiple JPEG outputs from the one PNG // input demonstrate making further transforms during conversion. -func Example_YCbCr444() { +func Example_yCbCr444() { // levels holds a rough, ad hoc measure of a coefficient's frequency, in // DCT space. Low (or high) levels[i] mean low (or high) frequency. // diff --git a/lib/lowleveljpeg/lowleveljpeg.go b/lib/lowleveljpeg/lowleveljpeg.go index cd889f3b..c4c2e550 100644 --- a/lib/lowleveljpeg/lowleveljpeg.go +++ b/lib/lowleveljpeg/lowleveljpeg.go @@ -103,7 +103,7 @@ type EncoderOptions struct { // // To get ArrayNBlockI16 values from pixels, use ExtractFrom on an image.Image // (to get an array of BlockU8 values) and then FowardDCTFrom (to get an array -// of BlockI16 values). See Example_Basic for an example. +// of BlockI16 values). See Example_basic for an example. // // An Encoder makes no allocations, other than the Encoder struct itself and // any allocations that the passed io.Writer makes. diff --git a/lib/zlibcut/example_test.go b/lib/zlibcut/example_test.go index 2333eb49..42e73b50 100644 --- a/lib/zlibcut/example_test.go +++ b/lib/zlibcut/example_test.go @@ -21,7 +21,7 @@ import ( "github.com/google/wuffs/lib/zlibcut" ) -func ExampleCut() { +func Example() { const sonnet18 = "" + "Shall I compare thee to a summer’s day?\n" + "Thou art more lovely and more temperate.\n" +