Commit 9ec89c6f authored by Jacob Vosmaer's avatar Jacob Vosmaer

Don't depend on Git version string in test

parent 423a1e57
...@@ -737,9 +737,13 @@ func TestGetGitPatch(t *testing.T) { ...@@ -737,9 +737,13 @@ func TestGetGitPatch(t *testing.T) {
t.Fatalf("Expected: From 54fcc214b94e78d7a41a9a8fe6d87a5e59500e51 Mon Sep 17 00:00:00 2001, got: %v", body) t.Fatalf("Expected: From 54fcc214b94e78d7a41a9a8fe6d87a5e59500e51 Mon Sep 17 00:00:00 2001, got: %v", body)
} }
bodyLengthBytes := len(body) // The contents of the last line of the patch depend on the version of
if bodyLengthBytes != 449 { // Git used during the test run. Ignore that data and look at the line
t.Fatal("Expected the body to consist of 449 bytes, got %v", bodyLengthBytes) // that should terminate the diff.
lastPatchIndex := 442
endOfPatch := string(body[lastPatchIndex-5 : lastPatchIndex])
if endOfPatch != "\n-- \n" {
t.Fatalf("Expected end of patch at %d, found %q", lastPatchIndex, endOfPatch)
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment