shithub: mc

ref: a555f36aad5963dc600bc0af9433c39ced49b476
dir: /lib/std/test/slcp.myr/

View raw version
use std

const main = {
	var a = [1,2,3,4,5]
	var b = [6,7,8,9,10]
	var a_cped = [3, 4, 5, 4, 5]
	var b_cped = [6, 7, 6, 7, 8]
	

	std.slcp(a[:a.len-2], a[2:])
	std.slcp(b[2:], b[:b.len-2])
	std.assert(std.sleq(a[:], a_cped[:]), "slcp of a failed: got {}, wanted {}", a[:], a_cped[:])
	std.assert(std.sleq(b[:], b_cped[:]), "slcp of b failed: got {}, wanted {}", b[:], b_cped[:])
}