1# vi: set ft=conf
2
3# convert crlf to lf on windows
4[windows] dos2unix blob1.txt blob2.txt blob3.txt
5
6# start soft serve
7exec soft serve &
8# wait for server to start
9waitforserver
10
11# create a repo
12soft repo create repo1
13
14# clone repo
15git clone ssh://localhost:$SSH_PORT/repo1 repo1
16
17# create some files, commits, tags...
18mkfile ./repo1/README.md '# Hello\n\nwelcome'
19mkfile ./repo1/main.go 'package main\nconst foo = 2\n'
20mkfile ./repo1/.hidden ''
21mkdir ./repo1/folder
22mkdir ./repo1/.folder
23mkfile ./repo1/folder/lib.c '//#include <stdio.h>'
24git -C repo1 add -A
25git -C repo1 commit -m 'first'
26git -C repo1 push origin HEAD
27
28# print root blob
29soft repo blob repo1 README.md
30cmp stdout blob1.txt
31
32# print file blob with revision with line numbers and colors
33soft repo blob repo1 master main.go -l -c
34cmp stdout blob2.txt
35
36
37# print file blob with revision within folder with lineno
38soft repo blob repo1 master folder/lib.c -l
39cmp stdout blob3.txt
40
41# print blob of folder that does not exist
42! soft repo blob repo1 folder/nope.txt
43! stdout .
44stderr 'revision does not exist'
45
46# print blob of bad revision
47! soft repo blob repo1 badrev README.md
48! stdout .
49stderr 'revision does not exist'
50
51# stop the server
52[windows] stopserver
53
54-- blob1.txt --
55# Hello\n\nwelcome
56-- blob2.txt --
57 [38;5;239m1[0m [38;5;236m│[0m [38;5;204m[0m[38;5;204mpackage[0m main[38;5;255m\[0mnconst foo [38;5;187m=[0m [38;5;85m2[0m[38;5;255m\[0mn
58-- blob3.txt --
59 1 │ //#include <stdio.h>