#
#  PRE: if return
#
string test_string

test_string = "test"

#
#	rpad tests
#
if (!(%rpad(%{test_string}, 7) == "test   ")) {
	test_fail
}

if (!(%rpad(%{test_string}, 2) == "test")) {
	test_fail
}

if (!(%rpad(%{test_string}, 7, 'x') == "testxxx")) {
	test_fail
}

if (!(%rpad(%{test_string}, 7, 'xy') == "testxyx")) {
	test_fail
}

#
#	lpad tests
#
if (!(%lpad(%{test_string}, 7) == "   test")) {
	test_fail
}

if (!(%lpad(%{test_string}, 2) == "test")) {
	test_fail
}

if (!(%lpad(%{test_string}, 7, 'x') == "xxxtest")) {
	test_fail
}

if (!(%lpad(%{test_string}, 7, 'xy') == "xyxtest")) {
	test_fail
}

success
