| 894 | } |
| 895 | |
| 896 | static bool cmdline_roundtrips(const char *const *argv) { |
| 897 | char cmd[4096]; |
| 898 | if (!cbm_build_win_cmdline(cmd, sizeof(cmd), argv)) { |
| 899 | return false; |
| 900 | } |
| 901 | char parsed[16][256]; |
| 902 | int pc = parse_win_cmdline(cmd, parsed, 16); |
| 903 | int oc = 0; |
| 904 | while (argv[oc]) { |
| 905 | oc++; |
| 906 | } |
| 907 | if (pc != oc) { |
| 908 | return false; |
| 909 | } |
| 910 | for (int i = 0; i < oc; i++) { |
| 911 | if (strcmp(argv[i], parsed[i]) != 0) { |
| 912 | return false; |
| 913 | } |
| 914 | } |
| 915 | return true; |
| 916 | } |
| 917 | |
| 918 | /* The exact index-worker argv: the command line with a JSON arg full of quotes. |
| 919 | * Round-trips, AND the emitted line must contain an ESCAPED quote (\") — the bare |
no test coverage detected