test_printing.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:zippy 作者: securesystemslab 项目源码 文件源码
def test_vector_pretty_print():

    # TODO : The unit vectors should print with subscripts but they just
    # print as `n_x` instead of making `x` a subscritp with unicode.

    # TODO : The pretty print division does not print correctly here:
    # w = alpha * N.x + sin(omega) * N.y + alpha / beta * N.z

    pp = VectorPrettyPrinter()

    expected = u(' 2\na  n_x + b n_y + c\u22c5sin(\u03b1) n_z')

    assert expected == pp.doprint(v)
    assert expected == v._pretty().render()

    expected = u('\u03b1 n_x + sin(\u03c9) n_y + \u03b1\u22c5\u03b2 n_z')

    assert expected == pp.doprint(w)
    assert expected == w._pretty().render()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号