]> git.ipfire.org Git - thirdparty/git.git/blame - t/t0070-fundamental.sh
Merge branch 'dl/checkout-p-merge-base'
[thirdparty/git.git] / t / t0070-fundamental.sh
CommitLineData
b4285c71
RS
1#!/bin/sh
2
3test_description='check that the most basic functions work
4
5
6Verify wrappers and compatibility functions.
7'
8
9. ./test-lib.sh
10
11test_expect_success 'character classes (isspace, isalpha etc.)' '
e4998944 12 test-tool ctype
b4285c71
RS
13'
14
6cf6bb3e 15test_expect_success 'mktemp to nonexistent directory prints filename' '
d9cc2c87 16 test_must_fail test-tool mktemp doesnotexist/testXXXXXX 2>err &&
6cf6bb3e
AE
17 grep "doesnotexist/test" err
18'
19
b3b8ceb4 20test_expect_success POSIXPERM,SANITY 'mktemp to unwritable directory prints filename' '
6cf6bb3e 21 mkdir cannotwrite &&
6cf6bb3e 22 test_when_finished "chmod +w cannotwrite" &&
03771425 23 chmod -w cannotwrite &&
d9cc2c87 24 test_must_fail test-tool mktemp cannotwrite/testXXXXXX 2>err &&
6cf6bb3e
AE
25 grep "cannotwrite/test" err
26'
27
253b27f1
DW
28test_expect_success 'git_mkstemps_mode does not fail if fd 0 is not open' '
29 git commit --allow-empty -m message <&-
30'
31
c9184159
RJ
32test_expect_success 'check for a bug in the regex routines' '
33 # if this test fails, re-build git with NO_REGEX=1
9038531f 34 test-tool regex --bug
c9184159
RJ
35'
36
17e7dbbc
JS
37test_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
41'
42
af22a63c
JK
43test_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
47'
48
49test_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
53'
54
b4285c71 55test_done