def sdscmp_test2(): sds_imp = SdsImp() s1 = sds_imp.sdsnew('hello') s2 = sds_imp.sdsnew(' hello') s = sds_imp.sdscmp(s1, s2) ensure(s == False, 'sds cmp test2')
def sdscmp_test1(): sds_imp = SdsImp() s1 = sds_imp.sdsnew('hello') s2 = sds_imp.sdsnew('hello') s = sds_imp.sdscmp(s1, s2) ensure(s == True, 'sds cmp test1')
def sdsnew_test1(): sds_imp = SdsImp() s = sds_imp.sdsnew('hello') ensure(s.buf == 'hello' and s.len == 5, 'sds new test1')
def sdscat_test2(): sds_imp = SdsImp() s1 = sds_imp.sdsnew('') s2 = sds_imp.sdsnew('') s = sds_imp.sdscat(s1, s2) ensure(s.len == 0 and s.buf == '', 'sds concat test2')
def sdscat_test1(): sds_imp = SdsImp() s1 = sds_imp.sdsnew('hello') s2 = sds_imp.sdsnew(' world') s = sds_imp.sdscat(s1, s2) ensure(s.len == 11 and s.buf == 'hello world', 'sds concat test1')
def sdslen_test2(): sds_imp = SdsImp() s = sds_imp.sdsempty() l = sds_imp.sdslen(s) ensure(l == 0, 'sds len test2')
def sdslen_test1(): sds_imp = SdsImp() s = sds_imp.sdsnew('hello') l = sds_imp.sdslen(s) ensure(l == 5, 'sds len test1')
def sdsnew_test2(): sds_imp = SdsImp() s = sds_imp.sdsempty() ensure(s.buf == '' and s.len == 0, 'sds new test2')