mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-24 06:12:27 +00:00
Get Fat Emacs working in Windows Console
This commit is contained in:
parent
bf835de612
commit
7100b1cf91
34 changed files with 479 additions and 168 deletions
|
@ -16,10 +16,23 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
void SetUpOnce(void) {
|
||||
if (!IsWindows()) {
|
||||
// TODO(jart): mock out that win32 i/o call
|
||||
tinyprint(2, program_invocation_name, ": skipping on non-windows\n", NULL);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(GetDosArgv, empty) {
|
||||
size_t max = 4;
|
||||
size_t size = ARG_MAX / 2;
|
||||
|
@ -184,3 +197,16 @@ TEST(GetDosArgv, cmdToil) {
|
|||
free(argv);
|
||||
free(buf);
|
||||
}
|
||||
|
||||
TEST(GetDosArgv, canonicalizesCurrentDirectoryCommandPath) {
|
||||
size_t max = 4;
|
||||
size_t size = ARG_MAX / 2;
|
||||
char *buf = malloc(size * sizeof(char));
|
||||
char **argv = malloc(max * sizeof(char *));
|
||||
ASSERT_SYS(0, 0, touch("emacs.com", 0755));
|
||||
EXPECT_EQ(1, GetDosArgv(u"emacs.com", buf, size, argv, max));
|
||||
EXPECT_STREQ(".\\emacs.com", argv[0]);
|
||||
EXPECT_EQ(NULL, argv[1]);
|
||||
free(argv);
|
||||
free(buf);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue