MCPcopy Create free account
hub / github.com/conda/constructor / test_bat_echo_esc

Function test_bat_echo_esc

tests/test_utils.py:52–71  ·  view source on GitHub ↗

Test escaping strings for Windows batch file ECHO commands.

()

Source from the content-addressed store, hash-verified

50
51
52def 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
74def test_get_condarc_content_with_write_condarc():

Callers

nothing calls this directly

Calls 1

bat_echo_escFunction · 0.90

Tested by

no test coverage detected