test_formatter.py 430 B

12345678910111213
  1. from formatter import escape_dollar
  2. def test_escape_dollar():
  3. cases = [
  4. {"input": "test", "expected": "test"},
  5. {"input": "$test", "expected": "$$test"},
  6. {"input": "$$test", "expected": "$$$$test"},
  7. {"input": "$$$test", "expected": "$$$$$$test"},
  8. {"input": "$test$", "expected": "$$test$$"},
  9. ]
  10. for case in cases:
  11. assert escape_dollar(case["input"]) == case["expected"]