checkout: fix "branch info" memory leaks
[git/debian.git] / t / t0070-fundamental.sh
blob8d59905ef099bf0ab46d0681568dd17d7ed85d98
1 #!/bin/sh
3 test_description='check that the most basic functions work
6 Verify wrappers and compatibility functions.
9 . ./test-lib.sh
11 test_expect_success 'character classes (isspace, isalpha etc.)' '
12 test-tool ctype
15 test_expect_success 'mktemp to nonexistent directory prints filename' '
16 test_must_fail test-tool mktemp doesnotexist/testXXXXXX 2>err &&
17 grep "doesnotexist/test" err
20 test_expect_success POSIXPERM,SANITY 'mktemp to unwritable directory prints filename' '
21 mkdir cannotwrite &&
22 test_when_finished "chmod +w cannotwrite" &&
23 chmod -w cannotwrite &&
24 test_must_fail test-tool mktemp cannotwrite/testXXXXXX 2>err &&
25 grep "cannotwrite/test" err
28 test_expect_success 'git_mkstemps_mode does not fail if fd 0 is not open' '
29 git commit --allow-empty -m message <&-
32 test_expect_success 'check for a bug in the regex routines' '
33 # if this test fails, re-build git with NO_REGEX=1
34 test-tool regex --bug
37 test_expect_success 'incomplete sideband messages are reassembled' '
38 test-tool pkt-line send-split-sideband >split-sideband &&
39 test-tool pkt-line receive-sideband <split-sideband 2>err &&
40 grep "Hello, world" err
43 test_expect_success 'eof on sideband message is reported' '
44 printf 1234 >input &&
45 test-tool pkt-line receive-sideband <input 2>err &&
46 test_i18ngrep "unexpected disconnect" err
49 test_expect_success 'missing sideband designator is reported' '
50 printf 0004 >input &&
51 test-tool pkt-line receive-sideband <input 2>err &&
52 test_i18ngrep "missing sideband" err
55 test_done