def unicode_test(seg_instance, seg_str):
            seg_gen_str = str(seg_instance)

            self.assertEqual(len(seg_gen_str), 240)
            self.assertEqual(len(seg_str), 240)
            self.assertEqual(seg_gen_str, seg_str)
def test_ccode_Rational():
    assert ccode(Rational(3, 7)) == "3.0L/7.0L"
    assert ccode(Rational(18, 9)) == "2"
    assert ccode(Rational(3, -7)) == "-3.0L/7.0L"
    assert ccode(Rational(-3, -7)) == "3.0L/7.0L"
    assert ccode(x + Rational(3, 7)) == "x + 3.0L/7.0L"
    assert ccode(Rational(3, 7)*x) == "(3.0L/7.0L)*x"