def test_sdm_add(): assert sdm_add([((1, 1, 1), QQ(1))], [((2, 0, 0), QQ(1))], lex, QQ) == \ [((2, 0, 0), QQ(1)), ((1, 1, 1), QQ(1))] assert sdm_add([((1, 1, 1), QQ(1))], [((1, 1, 1), QQ(-1))], lex, QQ) == [] assert sdm_add([((1, 0, 0), QQ(1))], [((1, 0, 0), QQ(2))], lex, QQ) == \ [((1, 0, 0), QQ(3))] assert sdm_add([((1, 0, 1), QQ(1))], [((1, 1, 0), QQ(1))], lex, QQ) == \ [((1, 1, 0), QQ(1)), ((1, 0, 1), QQ(1))]
def test_sdm_add(): assert sdm_add([((1, 1, 1), QQ(1))], [((2, 0, 0), QQ(1))], lex, QQ) == \ [((2, 0, 0), QQ(1)), ((1, 1, 1), QQ(1))] assert sdm_add([((1, 1, 1), QQ(1))], [((1, 1, 1), QQ(-1))], lex, QQ) == [] assert sdm_add([((1, 0, 0), QQ(1))], [((1, 0, 0), QQ(2))], lex, QQ) == \ [((1, 0, 0), QQ(3))] assert sdm_add([((1, 0, 1), QQ(1))], [((1, 1, 0), QQ(1))], lex, QQ) == \ [((1, 1, 0), QQ(1)), ((1, 0, 1), QQ(1))]