from soundchanger.change import reformat_change_to_regex def test_replace_spaces(): assert reformat_change_to_regex(' a > b / c _ d ') == 'a>b/c_d' def test_replace_brackets_and_commas(): assert reformat_change_to_regex('a>b/{#,a}_') == 'a>b/(#|a)_' def test_replace_categories(): assert reformat_change_to_regex('a>b/V_', categories={'V': 'aiu'} ) == 'a>b/(a|i|u)_' def test_replace_categories_in_brackets(): assert reformat_change_to_regex('a>b/{#,V}_', categories={'V': 'aiu'} ) == 'a>b/(#|(a|i|u))_' def test_replace_zero_characters(): assert reformat_change_to_regex('a>∅') == 'a>'