diff --git a/test/test_standardize.py b/test/test_standardize.py index 5f0ef52..ba62b6c 100644 --- a/test/test_standardize.py +++ b/test/test_standardize.py @@ -124,18 +124,6 @@ import org.junit.jupiter.api.DisplayName; public void zkBinderContextImplPropagatesLotFieldsDirectlyFromUnderlyingZkBinderContext() """ -INPUT_6 = """ -/** Fail when uploading the wrong share */ -@ContractTest(previous = "registerSharing") -void TODO2() { -""" - -OUTPUT_6 = """ -/** Fail when uploading the wrong share */ -@ContractTest(previous = "registerSharing") -void failWhenUploadingTheWrongShare() { -""" - JAVADOC_TO_DISPLAYNAME = [ (INPUT_1, OUTPUT_1), (INPUT_2, OUTPUT_2), @@ -145,7 +133,6 @@ JAVADOC_TO_DISPLAYNAME = [ (INPUT_5B, OUTPUT_5), (INPUT_5C, OUTPUT_5), (INPUT_5D, OUTPUT_5), - (INPUT_6, OUTPUT_6), ] @@ -156,6 +143,7 @@ def test_javadoc_to_displayname(inp: str, output: str): with_display_name=True, only_for_javadoc = False, only_for_display_name = False, + only_for_todo = False, naming_scheme=NamingScheme.FROM_DESC, ) converted = standardize_java_text(inp.strip(), config) diff --git a/test/test_standardize_from_todo.py b/test/test_standardize_from_todo.py new file mode 100644 index 0000000..76b11a2 --- /dev/null +++ b/test/test_standardize_from_todo.py @@ -0,0 +1,34 @@ +import pytest + +from standardize_test_format import NamingScheme, standardize_java_text, Config + +INPUT_6 = """ +/** Fail when uploading the wrong share */ +@ContractTest(previous = "registerSharing") +void TODO2() { +""" + +OUTPUT_6 = """ +/** Fail when uploading the wrong share */ +@ContractTest(previous = "registerSharing") +void failWhenUploadingTheWrongShare() { +""" + +NAME_FROM_COMMENT = [ + (INPUT_6, OUTPUT_6), +] + + +@pytest.mark.parametrize(('inp','output'), NAME_FROM_COMMENT) +def test_javadoc_to_displayname(inp: str, output: str): + config = Config( + with_javadoc=True, + with_display_name=False, + only_for_javadoc = False, + only_for_display_name = False, + only_for_todo = True, + naming_scheme=NamingScheme.FROM_DESC, + ) + converted = standardize_java_text(inp.strip(), config) + assert converted == output.strip() +