Skip to content
Myr

Add unit tests for nvm_checksum.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kevin Wang · committed by Kevin Wang · parent 814319d · Browse files · 1 file+18 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+18 added−0 removed

  • tests:+18 added−0 removed

1 file+18 added−0 removed

added:test/fast/Unit tests/nvm_checksum+18 added
1#!/bin/sh23cleanup () {4 rm tmp/emptyfile tmp/testfile5 rmdir tmp6}7die () { echo $@ ; exit 1; }89. ../../../nvm.sh1011mkdir -p tmp12touch tmp/emptyfile13echo -n "test" > tmp/testfile1415nvm_checksum tmp/emptyfile "da39a3ee5e6b4b0d3255bfef95601890afd80709" || die "nvm_checksum on an empty file did not match the SHA1 digest of the empty string"16nvm_checksum tmp/testfile "da39a3ee5e6b4b0d3255bfef95601890afd80709" && die "nvm_checksum allowed a bad checksum"1718cleanup