Commits

Shu Zong Chen committed f3fb12a

more test cases

Comments (0)

Files changed (1)

 		for i, j in fusable:
 			if i in r:
 				ret = r.split(i, 1)
-				if len(i) == 4:
-					return ret[0] + j + RAAR._fusion(ret[1])
-				else:
-					return ret[0] + j + RAAR._fusion(ret[1])
-					return j + ret[0] + RAAR._fusion(ret[1])
+				return ret[0] + j + RAAR._fusion(ret[1])
 		return r
 
 	@staticmethod
 		for i in _val_in_order:
 			v = RAAR.r_val(i)
 			n_i = rem/v
-			ret.append((v, n_i))
+ 			ret.append((v, n_i))
 			rem = rem % v
 		return ret
 
 if __name__ == '__main__':
 	r2a_tests = {
 		'MCCCCCCVI': 1606,
+		'MDCVI': 1606,
 		'XXVIIII': 29,
 		'IIX': 8,
 		'IX': 9,
 		'III': 3,
 		'IV': 4,
 		'V': 5,
+		'MDCCCCLXXXXVIIII': 1999,
+		'MCMXCIX': 1999,
+		'MIM': 1999,
 	}
 	for r, a in r2a_tests.iteritems():
 		assert RAAR.r2a(r) == a