Skip to content

Commit 2d19b5d

Browse files
committed
tests: add new test in fixtures/sourcing.sh
I added this to the bottom of the file to minimize snapshot diffs. they're large enough as it is.
1 parent a907852 commit 2d19b5d

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

server/src/__tests__/analyzer.test.ts

+23
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,28 @@ describe('analyze', () => {
123123
"severity": 3,
124124
"source": "bash-language-server",
125125
},
126+
{
127+
"message": "Source command could not be analyzed: failed to resolve path.
128+
129+
Consider adding a ShellCheck directive above this line to fix or ignore this:
130+
# shellcheck source=/my-file.sh # specify the file to source
131+
# shellcheck source-path=my_script_folder # specify the folder to search in
132+
# shellcheck source=/dev/null # to ignore the error
133+
134+
Disable this message by changing the configuration option "enableSourceErrorDiagnostics"",
135+
"range": {
136+
"end": {
137+
"character": 49,
138+
"line": 26,
139+
},
140+
"start": {
141+
"character": 0,
142+
"line": 26,
143+
},
144+
},
145+
"severity": 3,
146+
"source": "bash-language-server",
147+
},
126148
]
127149
`)
128150

@@ -847,6 +869,7 @@ describe('initiateBackgroundAnalysis', () => {
847869
[expect.stringContaining('parse-problems.sh: syntax error')],
848870
[expect.stringContaining('sourcing.sh line 16: failed to resolve path')],
849871
[expect.stringContaining('sourcing.sh line 21: non-constant source not supported')],
872+
[expect.stringContaining('sourcing.sh line 26: failed to resolve path')],
850873
])
851874

852875
// Intro, stats on glob, one file skipped due to shebang, and outro

testing/fixtures/sourcing.sh

+2
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ loadlib () {
2323
}
2424

2525
loadlib "issue206"
26+
27+
source $SCRIPT_DIR/tag-release.inc with arguments

0 commit comments

Comments
 (0)