-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from netlify/add-use-asset-mgmt
Add feature to create file.Sum with original sha included for asset mgmt (again)
- Loading branch information
Showing
5 changed files
with
131 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package porcelain | ||
|
||
import ( | ||
"strings" | ||
"testing" | ||
) | ||
|
||
func TestGetAssetManagementSha(t *testing.T) { | ||
tests := []struct { | ||
contents string | ||
length int | ||
}{ | ||
{"Not a pointer file", 0}, | ||
{"version https://git-lfs.github.com/spec/v1\n" + | ||
"oid sha256:7e56e498ccb4cbb9c672e1aed6710fb91b2fd314394a666c11c33b2059ea3d71\n" + | ||
"size 1743570", 64}, | ||
} | ||
|
||
for _, test := range tests { | ||
file := strings.NewReader(test.contents) | ||
out := getAssetManagementSha(file) | ||
if len(out) != test.length { | ||
t.Fatalf("expected `%d`, got `%d`", test.length, len(out)) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters