コード例 #1
0
def test_peek():
    tokens = [["word", "test"],["int", 1]]
    assert args.peek(tokens, "word"), "There should be a word."
    assert len(tokens) == 2, "Args should not go down after peek."
    args.match(tokens, "word")

    assert args.peek(tokens, "int"), "There should be an int."
    assert not args.peek(tokens, "option"), "There should not be an option."
    args.match(tokens, "int")
コード例 #2
0
def test_peek():
    tokens = [["word", "test"], ["int", 1]]
    assert args.peek(tokens, "word"), "There should be a word."
    assert len(tokens) == 2, "Args should not go down after peek."
    args.match(tokens, "word")

    assert args.peek(tokens, "int"), "There should be an int."
    assert not args.peek(tokens, "option"), "There should not be an option."
    args.match(tokens, "int")
コード例 #3
0
def test_peek_fails():
    tokens = []
    args.peek(tokens, 'string')
コード例 #4
0
def test_peek_fails():
    tokens = []
    args.peek(tokens, 'string')