File: t1013-sbuf.t

package info (click to toggle)
jgmenu 4.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,464 kB
  • sloc: ansic: 13,215; perl: 4,953; sh: 3,009; python: 600; makefile: 294; xml: 98
file content (50 lines) | stat: -rwxr-xr-x 482 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh

test_description='test string buffer routines'
. ./sharness.sh

test_sbuf() {
	echo "$1" | ../helper/test-sbuf > actual &&
	echo "$2" > expect &&
	test_cmp expect actual
}

test_expect_success 'addstr' '

test_sbuf "addstr ABCDEFGHIJKLMNO
print
len
bufsiz
addstr P
print
len
bufsiz
" "ABCDEFGHIJKLMNO
15
16
ABCDEFGHIJKLMNOP
16
17"

'

test_expect_success 'prepend' '

test_sbuf "cpy bar
print
len
bufsiz
prepend foo
print
len
bufsiz
" "bar
3
4
foobar
6
10"

'

test_done