Skip to content

Commit 267005c

Browse files
committed
fix: correct example test names to match Go conventions
Rename example test functions to match the actual functions they demonstrate: - ExampleOperator_Decimal → ExampleOperator_with_decimal - ExampleWithTimezone → ExampleTimezone - ExampleGetUnifiedDiffCode → ExampleGetUnifiedDiffString - ExampleGetContextDiffCode → ExampleGetContextDiffString - ExampleGetContextDiffString → ExampleGetContextDiffString_second These changes fix test failures in Go 1.24, which enforces stricter naming conventions for example tests. In Go, example tests must be named after the exact function or method they demonstrate. Signed-off-by: Ville Vesilehto <[email protected]>
1 parent 867dca6 commit 267005c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

expr_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ func ExampleOperator() {
312312
// Output: true
313313
}
314314

315-
func ExampleOperator_Decimal() {
315+
func ExampleOperator_with_decimal() {
316316
type Decimal struct{ N float64 }
317317
code := `A + B - C`
318318

@@ -585,7 +585,7 @@ func ExampleWithContext() {
585585
// Output: 42
586586
}
587587

588-
func ExampleWithTimezone() {
588+
func ExampleTimezone() {
589589
program, err := expr.Compile(`now().Location().String()`, expr.Timezone("Asia/Kamchatka"))
590590
if err != nil {
591591
fmt.Printf("%v", err)

internal/difflib/difflib_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ group
102102
}
103103
}
104104

105-
func ExampleGetUnifiedDiffCode() {
105+
func ExampleGetUnifiedDiffString() {
106106
a := `one
107107
two
108108
three
@@ -135,7 +135,7 @@ four`
135135
// -fmt.Printf("%s,%T",a,b)
136136
}
137137

138-
func ExampleGetContextDiffCode() {
138+
func ExampleGetContextDiffString() {
139139
a := `one
140140
two
141141
three
@@ -172,7 +172,7 @@ four`
172172
// four
173173
}
174174

175-
func ExampleGetContextDiffString() {
175+
func ExampleGetContextDiffString_second() {
176176
a := `one
177177
two
178178
three

0 commit comments

Comments
 (0)