<commit_before>from textwrap import dedent

def test_target_specific_variable(shell):
    shell.src('Makefile', """
    VAR = global

    not-target-specific:
    	@echo -n 'VAR = $(VAR)'

    target-specific: VAR = target-specific
    target-specific:
    	@echo -n 'VAR = $(VAR)'
    """)

    r1 = shell.run('make not-target-specific')
    r2 = shell.run('make target-specific')

    assert r1.out == 'VAR = global'
    assert r2.out == 'VAR = target-specific'<commit_msg>[make] Empty string<commit_after>from textwrap import dedent

def test_variable__empty_string(shell):
    shell.src('Makefile', """
    IMPLICIT_EMPTY =
    EXPLICIT_EMPTY = ''

    target:
    	@echo -n
    	$(info Implicit = [$(IMPLICIT_EMPTY)])
    	$(info Explicit = [$(EXPLICIT_EMPTY)])
    """)

    # Value `''` doesn't mean empty string to make itself
    assert shell.run('make').out == "Implicit = []\nExplicit = ['']\n"

def test_target_specific_variable(shell):
    shell.src('Makefile', """
    VAR = global

    not-target-specific:
    	@echo -n 'VAR = $(VAR)'

    target-specific: VAR = target-specific
    target-specific:
    	@echo -n 'VAR = $(VAR)'
    """)

    r1 = shell.run('make not-target-specific')
    r2 = shell.run('make target-specific')

    assert r1.out == 'VAR = global'
    assert r2.out == 'VAR = target-specific'
{'fraction_non_alphanumeric': 0.15987933634992457, 'fraction_numerical': 0.006033182503770739, 'mean_word_length': 3.021212121212121, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7221148', 'n_tokens_mistral': 459, 'n_tokens_neox': 451, 'n_words': 100}