shithub: mc

ref: 4db5274a2f6db10e31e11c503f36c85a98c65fbc
dir: /test/strfind.myr/

View raw version
use std

const main = {
	printloc(std.strfind("", ""))
	printloc(std.strfind("", "a"))
	printloc(std.strfind("ab", "abc"))
	printloc(std.strfind("abc", "abc"))
	printloc(std.strfind("abcde", "abc"))
	printloc(std.strfind("abcde", "xyz"))
	printloc(std.strfind("abcde", "bcd"))
	printloc(std.strfind("abcde", "cde"))
	printloc(std.strfind("abcde", "def"))
	printloc(std.strfind("abcde", "abx"))
}

const printloc = {l
	match l
	| `std.Some loc:	std.put("Found {}\n", loc)
	| `std.None:	std.put("No match\n")
	;;
}