Test escaping strings for Windows batch file ECHO commands.
()
| 50 | |
| 51 | |
| 52 | def test_bat_echo_esc(): |
| 53 | """Test escaping strings for Windows batch file ECHO commands.""" |
| 54 | # Plain strings pass through unchanged |
| 55 | assert bat_echo_esc("foo") == "foo" |
| 56 | assert bat_echo_esc("foo bar") == "foo bar" |
| 57 | |
| 58 | # Special characters are escaped |
| 59 | assert bat_echo_esc("a & b") == "a ^& b" |
| 60 | assert bat_echo_esc("a | b") == "a ^| b" |
| 61 | assert bat_echo_esc("a < b > c") == "a ^< b ^> c" |
| 62 | assert bat_echo_esc("a^b") == "a^^b" |
| 63 | |
| 64 | # Percent and exclamation are NOT escaped (unlike bat_env_var_esc) |
| 65 | assert bat_echo_esc("50%") == "50%" |
| 66 | assert bat_echo_esc("foo!") == "foo!" |
| 67 | |
| 68 | # Virtual specs examples |
| 69 | assert bat_echo_esc("__win<0") == "__win^<0" |
| 70 | assert bat_echo_esc("__cuda>=11") == "__cuda^>=11" |
| 71 | assert bat_echo_esc("__win<0 __cuda>=11") == "__win^<0 __cuda^>=11" |
| 72 | |
| 73 | |
| 74 | def test_get_condarc_content_with_write_condarc(): |
nothing calls this directly
no test coverage detected