inherit(lib::test);

class StringTest{
	simple#Test{
		assert "test".length==4;
		assert ("te"~"st").length==4;
		assert ("te"~"st")=="test";
		assert "4".to_i==4;
		assert "%s"("a")=="a";
		assert "%(2)s%(1)s"("a", "b")=="ba";
		assert "%(b)s%(a)s"(a:"a", b:"b")=="ba";
	}
	
	sub#Test{
		assert "Hello".sub("l", fun(x) "L")=="HeLlo";
		assert "Hello".gsub("l", fun(x) "L")=="HeLLo";
		assert "Hello".sub("l"*2, fun(x) "O")=="HeOo";
	}
}
