mirror of
				https://github.com/gohugoio/hugo.git
				synced 2024-05-11 05:54:58 +00:00 
			
		
		
		
	Reinsert deleted test
This test was deleted by mistake in owenwaller's contribution to add more tests. I haven't looked closer, there may be more missing.
This commit is contained in:
		@@ -55,6 +55,29 @@ func TestMakePathToLower(t *testing.T) {
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func TestMakePathRelative(t *testing.T) {
 | 
			
		||||
	type test struct {
 | 
			
		||||
		inPath, path1, path2, output string
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	data := []test{
 | 
			
		||||
		{"/abc/bcd/ab.css", "/abc/bcd", "/bbc/bcd", "/ab.css"},
 | 
			
		||||
		{"/abc/bcd/ab.css", "/abcd/bcd", "/abc/bcd", "/ab.css"},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for i, d := range data {
 | 
			
		||||
		output, _ := MakePathRelative(d.inPath, d.path1, d.path2)
 | 
			
		||||
		if d.output != output {
 | 
			
		||||
			t.Errorf("Test #%d failed. Expected %q got %q", i, d.output, output)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	_, error := MakePathRelative("a/b/c.ss", "/a/c", "/d/c", "/e/f")
 | 
			
		||||
 | 
			
		||||
	if error == nil {
 | 
			
		||||
		t.Errorf("Test #%d failed. Expected error")
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func TestMakeTitle(t *testing.T) {
 | 
			
		||||
	type test struct {
 | 
			
		||||
		input, expected string
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user