File tree Expand file tree Collapse file tree 4 files changed +17
-8
lines changed Expand file tree Collapse file tree 4 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,15 @@ All notable changes to this project will be documented in this file. It uses the
77 [ Semantic Versioning ] : https://semver.org/spec/v2.0.0.html
88 "Semantic Versioning 2.0.0"
99
10+ ## [ v0.4.1] — Unreleased
11+
12+ ### 🪲 Bug Fixes
13+
14+ * Fixed the panic messages from ` spec.Slice ` to properly report coming from
15+ ` Slice ` and not ` NewSlice ` .
16+
17+ [ v0.4.1 ] : https://github.com/theory/jsonpath/compare/v0.4.0...v0.4.1
18+
1019## [ v0.4.0] — 2025-01-15
1120
1221### ⚡ Improvements
Original file line number Diff line number Diff line change @@ -2,11 +2,11 @@ GO ?= go
22
33.PHONY : test # Run the unit tests
44test :
5- $(GO ) test ./... -count=1
5+ GOTOOLCHAIN=local $(GO ) test ./... -count=1
66
77.PHONY : cover # Run test coverage
88cover : $(shell find . -name \* .go)
9- $(GO ) test -v -coverprofile=cover.out -covermode=count ./...
9+ GOTOOLCHAIN=local $(GO ) test -v -coverprofile=cover.out -covermode=count ./...
1010 @$(GO ) tool cover -html=cover.out
1111
1212.PHONY : lint # Lint the project
Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ func Slice(args ...any) SliceSelector {
278278 case nil :
279279 // Nothing to do
280280 default :
281- panic ("Third value passed to NewSlice is not an integer" )
281+ panic ("Third value passed to Slice is not an integer" )
282282 }
283283 fallthrough
284284 case endArg :
@@ -292,7 +292,7 @@ func Slice(args ...any) SliceSelector {
292292 s .end = math .MinInt
293293 }
294294 default :
295- panic ("Second value passed to NewSlice is not an integer" )
295+ panic ("Second value passed to Slice is not an integer" )
296296 }
297297 fallthrough
298298 case startArg :
@@ -305,7 +305,7 @@ func Slice(args ...any) SliceSelector {
305305 s .start = math .MaxInt
306306 }
307307 default :
308- panic ("First value passed to NewSlice is not an integer" )
308+ panic ("First value passed to Slice is not an integer" )
309309 }
310310 }
311311 return s
Original file line number Diff line number Diff line change @@ -336,15 +336,15 @@ func TestSlicePanic(t *testing.T) {
336336 a := assert .New (t )
337337
338338 a .PanicsWithValue (
339- "First value passed to NewSlice is not an integer" ,
339+ "First value passed to Slice is not an integer" ,
340340 func () { Slice ("hi" ) },
341341 )
342342 a .PanicsWithValue (
343- "Second value passed to NewSlice is not an integer" ,
343+ "Second value passed to Slice is not an integer" ,
344344 func () { Slice (nil , "hi" ) },
345345 )
346346 a .PanicsWithValue (
347- "Third value passed to NewSlice is not an integer" ,
347+ "Third value passed to Slice is not an integer" ,
348348 func () { Slice (nil , 42 , "hi" ) },
349349 )
350350}
You can’t perform that action at this time.
0 commit comments