@@ -228,40 +228,6 @@ func TestTree(t *testing.T) {
228228 test (t , tree , "/prefix42" , 1 , "path" , "42" )
229229 test (t , tree , "/prefixnowhere/like/this" , 1 , "path" , "nowhere/like/this" )
230230 })
231-
232- t .Run ("escape wildcard" , func (t * testing.T ) {
233- t .Run ("static leftmost" , func (t * testing.T ) {
234- tree := New [int ]()
235- require .NoError (t , tree .Insert ("\\ :hello/\\ :world" , 1 ))
236- value , found := tree .Lookup (":hello/:world" , nil )
237- require .True (t , found )
238- require .Equal (t , 1 , value )
239- })
240-
241- t .Run ("static rightmost" , func (t * testing.T ) {
242- tree := New [int ]()
243- require .NoError (t , tree .Insert ("/\\ :hello" , 1 ))
244- value , found := tree .Lookup ("/:hello" , nil )
245- require .True (t , found )
246- require .Equal (t , 1 , value )
247- })
248-
249- t .Run ("dynamic" , func (t * testing.T ) {
250- tree := New [int ]()
251- require .NoError (t , tree .Insert ("/\\ :hello/:name" , 1 ))
252- wildcards := kv .New ()
253- value , found := tree .Lookup ("/:hello/Pavlo" , wildcards )
254- require .True (t , found )
255- require .Equal (t , 1 , value )
256- require .Equal (t , "Pavlo" , wildcards .Value ("name" ))
257- })
258- })
259-
260- t .Run ("path classifier" , func (t * testing.T ) {
261- require .False (t , IsDynamicTemplate ("\\ :hello/\\ :world" ))
262- require .False (t , IsDynamicTemplate ("/\\ :hello" ))
263- require .True (t , IsDynamicTemplate ("/\\ :hello/:name" ))
264- })
265231}
266232
267233// isn't used anymore. Left just in case the tree needs to be debugged.
0 commit comments