# Test file for Pextlib's base32 commands.
# Syntax:
# tclsh base32.tcl <Pextlib name>

proc main {pextlibname} {
	load $pextlibname
	
	if {[base32encode "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"] != "4OYMIQUY7QOBJGX36TEJS35ZEQT24QPEMSNZGTFESWMRW6CSXBKQ===="} {
		puts {[base32encode "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"] != "4OYMIQUY7QOBJGX36TEJS35ZEQT24QPEMSNZGTFESWMRW6CSXBKQ===="}
		exit 1
	}

	if {[base32decode "4OYMIQUY7QOBJGX36TEJS35ZEQT24QPEMSNZGTFESWMRW6CSXBKQ===="] != "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"} {
		puts {[base32decode "4OYMIQUY7QOBJGX36TEJS35ZEQT24QPEMSNZGTFESWMRW6CSXBKQ===="] != "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
		exit 1
	}
}

main $argv
