コード例 #1
0
def test_pyfun2r_ops_power():
    from benchmark import convert2r
    code = 'x = x ** (x+1)'
    rcode = convert2r.pyfun2r(code)
    assert (rcode.replace(' ', '') == 'x<-x^(x+1)')
コード例 #2
0
def test_pyfun2r_ops_inc():
    from benchmark import convert2r
    code = 'x = x[0]'
    rcode = convert2r.pyfun2r(code)
    assert (rcode.replace(' ', '') == 'x<-x[1]')
コード例 #3
0
def test_pyfun2r_ops_plusminus():
    from benchmark import convert2r
    code = 'x += 100'
    rcode = convert2r.pyfun2r(code)
    assert (rcode.replace(' ', '') == 'x<-x+100')