Commit b634a730e0a867de83e309323cb2c57c2714d0da
Make hashes in test more explicit
Charles Lehner committed on 2/8/2016, 4:37:24 AMParent: 17c29f2cc34026a1af2ec44ea384e15716514a8f
Files changed
test/run.js | changed |
test/run.js | ||
---|---|---|
@@ -75,19 +75,22 @@ | ||
75 | 75 | tape('make a commit and push', function (t) { |
76 | 76 | var commitMessage = 'Initial commit' |
77 | 77 | var fileName = 'blah.txt' |
78 | 78 | var fileContents = 'i am a file' |
79 | - var fileHash = new Buffer(20) | |
80 | - fileHash.hexWrite('68bd10497ea68e91fa85024d0a0b2fe54e212914') | |
79 | + var fileHash = '68bd10497ea68e91fa85024d0a0b2fe54e212914' | |
80 | + var treeHash = '75c54aa020772a916853987a03bff7079463a861' | |
81 | + var commitHash = 'edb5b50e8019797925820007d318870f8c346726' | |
82 | + var fileHashBuf = new Buffer(20) | |
83 | + fileHashBuf.hexWrite(fileHash) | |
81 | 84 | |
82 | 85 | var objects = t.items(t.deepEquals, [ |
83 | 86 | [{ |
84 | 87 | type: 'commit', |
85 | - data: 'tree 75c54aa020772a916853987a03bff7079463a861\nauthor ' + userStr + ' 1000000000 -0500\ncommitter ' + userStr + ' 1000000000 -0500\n\n' + commitMessage + '\n' | |
88 | + data: 'tree ' + treeHash + '\nauthor ' + userStr + ' 1000000000 -0500\ncommitter ' + userStr + ' 1000000000 -0500\n\n' + commitMessage + '\n' | |
86 | 89 | }, 'got the commit'], |
87 | 90 | [{ |
88 | 91 | type: 'tree', |
89 | - data: '100644 ' + fileName + '\0' + fileHash.toString('ascii') | |
92 | + data: '100644 ' + fileName + '\0' + fileHashBuf.toString('ascii') | |
90 | 93 | }, 'got the tree'], |
91 | 94 | [{ |
92 | 95 | type: 'blob', data: fileContents |
93 | 96 | }, 'got the blob'] |
@@ -95,9 +98,9 @@ | ||
95 | 98 | |
96 | 99 | var refs = t.items(t.deepEquals, [ |
97 | 100 | [{ |
98 | 101 | name: 'refs/heads/master', |
99 | - new: 'edb5b50e8019797925820007d318870f8c346726', | |
102 | + new: commitHash, | |
100 | 103 | old: null |
101 | 104 | }, 'got the ref'] |
102 | 105 | ]) |
103 | 106 |
Built with git-ssb-web