mirror of
				https://github.com/labstack/echo.git
				synced 2025-10-30 23:57:38 +02:00 
			
		
		
		
	
							
								
								
									
										12
									
								
								echo_test.go
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								echo_test.go
									
									
									
									
									
								
							| @@ -219,17 +219,17 @@ func TestEchoGroup(t *testing.T) { | |||||||
| 		t.Errorf("should execute middleware 3, executed %s", b.String()) | 		t.Errorf("should execute middleware 3, executed %s", b.String()) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	// Nested Group | 	// Nested group | ||||||
| 	g3 := e.Group("/group3") | 	g3 := e.Group("/group3") | ||||||
| 	g4 := g3.Group("/group4") | 	g4 := g3.Group("/group4") | ||||||
| 	g4.Get("/test", func(c *Context) { | 	g4.Get("/home", func(c *Context) { | ||||||
| 		c.String(http.StatusOK, "okay") | 		c.NoContent(http.StatusOK) | ||||||
| 	}) | 	}) | ||||||
| 	w = httptest.NewRecorder() | 	w = httptest.NewRecorder() | ||||||
| 	r, _ = http.NewRequest(GET, "/group3/group4/test", nil) | 	r, _ = http.NewRequest(GET, "/group3/group4/home", nil) | ||||||
| 	e.ServeHTTP(w, r) | 	e.ServeHTTP(w, r) | ||||||
| 	if w.Body.String() != "okay" { | 	if w.Code != 200 { | ||||||
| 		t.Error("body should be okay") | 		t.Errorf("status code should be 200, found %d", w.Code) | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user