Skip to content

Commit 8533228

Browse files
committed
Merge branch 'release/release-v0.1' of github.com:codingtools/cdt into fix/validating-hashing-issue-34
2 parents 0e2ed8b + aff1c64 commit 8533228

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/utilities/utilities.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ export default class Utilities {
3434

3535
thisRef.log(fileStr.length)
3636

37-
// TODO: fix this Issue #3
38-
if (fileStr.charAt(fileStr.length - 1) === '\n') {
39-
fileStr = fileStr.substring(0, fileStr.length - 1)
40-
}
4137
}
4238
return fileStr
4339
}

test/commands/hash.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,15 @@ describe('hash', () => {
8787
.stdout()
8888
.command(['hash', '-f', 'test/resources/test.txt'])
8989
.it("File Hashing -> cdt hash -f 'test/resources/test.txt'", ctx => {
90-
expect(ctx.stdout).to.contain('97ee6255ffc855e79e2324d5495b6538e29034f9')
90+
expect(ctx.stdout).to.contain('d246b69fd991a1256f9e00f6914c8bd2d52b432e')
91+
})
92+
93+
//file input sha512
94+
test
95+
.stdout()
96+
.command(['hash', '-f', 'test/resources/test.txt', '-t', 'sha512'])
97+
.it("File Hashing -> cdt hash -t sha512 -f 'test/resources/test.txt'", ctx => {
98+
expect(ctx.stdout).to.contain('4493b97b4a0d21fc561070c48d4a62a9bfbeb78c5d9b3c59abf6d41f70da2e9bd45af63d8c62812cf41e50e352ec41b4f407f71d5778b575c503b70081e7a151')
9199
})
92100

93101
//file input - file not found

0 commit comments

Comments
 (0)