mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-03 19:17:29 -05:00 
			
		
		
		
	Change date of the files in test to serve the static file and not generate a new one
This commit is contained in:
		
							parent
							
								
									705cd16dee
								
							
						
					
					
						commit
						da794a866e
					
				@ -3,8 +3,10 @@ package markdown
 | 
				
			|||||||
import (
 | 
					import (
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
	"net/http/httptest"
 | 
						"net/http/httptest"
 | 
				
			||||||
 | 
						"os"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
	"testing"
 | 
						"testing"
 | 
				
			||||||
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/mholt/caddy/middleware"
 | 
						"github.com/mholt/caddy/middleware"
 | 
				
			||||||
	"github.com/russross/blackfriday"
 | 
						"github.com/russross/blackfriday"
 | 
				
			||||||
@ -139,6 +141,10 @@ func getTrue() bool {
 | 
				
			|||||||
		t.Fatalf("Could not create HTTP request: %v", err)
 | 
							t.Fatalf("Could not create HTTP request: %v", err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	rec = httptest.NewRecorder()
 | 
						rec = httptest.NewRecorder()
 | 
				
			||||||
 | 
						currenttime := time.Now().Local().Add(-time.Second)
 | 
				
			||||||
 | 
						err = os.Chtimes("testdata/og/first.md", currenttime, currenttime)
 | 
				
			||||||
 | 
						currenttime = time.Now().Local()
 | 
				
			||||||
 | 
						err = os.Chtimes("testdata/og_static/og/first.md/index.html", currenttime, currenttime)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	md.ServeHTTP(rec, req)
 | 
						md.ServeHTTP(rec, req)
 | 
				
			||||||
	if rec.Code != http.StatusOK {
 | 
						if rec.Code != http.StatusOK {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user