diff --git a/tests/test_parse.py b/tests/test_parse.py index d44efe6..2ff184c 100644 --- a/tests/test_parse.py +++ b/tests/test_parse.py @@ -15,7 +15,7 @@ from tests.test_syntax import ( draw_token_classified, draw_syntax_random, - draw_token_location, + draw_syntax_location, draw_syntax_token, ) @@ -51,7 +51,7 @@ @composite def draw_token_by_value(draw, value): - location = draw(draw_token_location()) + location = draw(draw_syntax_location()) type = SyntaxType.TOKEN return Syntax(value, location, type) diff --git a/tests/test_syntax.py b/tests/test_syntax.py index 80633b8..8dc7c8f 100644 --- a/tests/test_syntax.py +++ b/tests/test_syntax.py @@ -33,9 +33,9 @@ ] -# Draws a random token location +# Draws a random syntax location @composite -def draw_token_location(draw): +def draw_syntax_location(draw): line = draw(integers()) column = draw(integers()) filename = draw(text()) @@ -52,7 +52,7 @@ @composite def draw_syntax_token(draw): value = draw(draw_token_classified()) - location = draw(draw_token_location()) + location = draw(draw_syntax_location()) type = SyntaxType.TOKEN return Syntax(value.value, location, type) @@ -61,7 +61,7 @@ @composite def draw_syntax_text(draw): value = draw(text()) - location = draw(draw_token_location()) + location = draw(draw_syntax_location()) type = SyntaxType.TEXT return Syntax(value, location, type) @@ -77,7 +77,7 @@ # Test syntax getters -@given(text(), draw_token_location(), draw_syntax_type()) +@given(text(), draw_syntax_location(), draw_syntax_type()) def test_syntax_syntax_getters(value, location, type): # Use text as a somewhat random value test = Syntax(value, location, type) @@ -101,7 +101,7 @@ @composite def draw_token_random(draw): value = draw(text()) - location = draw(draw_token_location()) + location = draw(draw_syntax_location()) return Syntax(value, location, SyntaxType.TOKEN) @@ -187,7 +187,7 @@ # Test location equals -@given(draw_token_location(), draw_token_location()) +@given(draw_syntax_location(), draw_syntax_location()) def test_syntax_location_equality(location1, location2): equals = ( location1.line == location2.line @@ -198,7 +198,7 @@ # Test token getters -@given(text(), draw_token_location()) +@given(text(), draw_syntax_location()) def test_syntax_token_getters(value, location): test = Syntax(value, location, SyntaxType.TOKEN) assert test.value == value