mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-03 19:17:29 -05:00 
			
		
		
		
	Merge pull request #1734 from tw4452852/ineffassign
markdown: fix the real ineffectual assignments in test
This commit is contained in:
		
						commit
						4750699ab0
					
				@ -81,17 +81,14 @@ func TestMarkdown(t *testing.T) {
 | 
				
			|||||||
		req, err := http.NewRequest("GET", url, nil)
 | 
							req, err := http.NewRequest("GET", url, nil)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			t.Fatalf("Could not create HTTP request: %v", err)
 | 
								t.Fatalf("Could not create HTTP request: %v", err)
 | 
				
			||||||
			return ""
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		rec := httptest.NewRecorder()
 | 
							rec := httptest.NewRecorder()
 | 
				
			||||||
		code, err := md.ServeHTTP(rec, req)
 | 
							code, err := md.ServeHTTP(rec, req)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			t.Fatal(err)
 | 
								t.Fatal(err)
 | 
				
			||||||
			return ""
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if code != http.StatusOK {
 | 
							if code != http.StatusOK {
 | 
				
			||||||
			t.Fatalf("Wrong status, expected: %d and got %d", http.StatusOK, code)
 | 
								t.Fatalf("Wrong status, expected: %d and got %d", http.StatusOK, code)
 | 
				
			||||||
			return ""
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return rec.Body.String()
 | 
							return rec.Body.String()
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -117,6 +114,10 @@ Welcome to A Caddy website!
 | 
				
			|||||||
</body>
 | 
					</body>
 | 
				
			||||||
</html>
 | 
					</html>
 | 
				
			||||||
`
 | 
					`
 | 
				
			||||||
 | 
						if respBody != expectedBody {
 | 
				
			||||||
 | 
							t.Fatalf("Expected body:\n%q\ngot:\n%q", expectedBody, respBody)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	respBody = get("/docflags/test.md")
 | 
						respBody = get("/docflags/test.md")
 | 
				
			||||||
	expectedBody = `Doc.var_string hello
 | 
						expectedBody = `Doc.var_string hello
 | 
				
			||||||
Doc.var_bool true
 | 
					Doc.var_bool true
 | 
				
			||||||
@ -226,11 +227,9 @@ func TestTemplateReload(t *testing.T) {
 | 
				
			|||||||
		code, err := md.ServeHTTP(rec, req)
 | 
							code, err := md.ServeHTTP(rec, req)
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			t.Fatal(err)
 | 
								t.Fatal(err)
 | 
				
			||||||
			return ""
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if code != http.StatusOK {
 | 
							if code != http.StatusOK {
 | 
				
			||||||
			t.Fatalf("Wrong status, expected: %d and got %d", http.StatusOK, code)
 | 
								t.Fatalf("Wrong status, expected: %d and got %d", http.StatusOK, code)
 | 
				
			||||||
			return ""
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return rec.Body.String()
 | 
							return rec.Body.String()
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user