Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions internal/tsoptions/commandlineparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ func getInputOptionName(input string) string {
}

func (p *commandLineParser) parseResponseFile(fileName string) {
if fileName == "" {
p.errors = append(p.errors, ast.NewCompilerDiagnostic(diagnostics.Cannot_read_file_0, fileName))
return
}
fileContents, errors := tryReadFile(fileName, func(fileName string) (string, bool) {
if p.fs == nil {
return "", false
Expand Down
9 changes: 9 additions & 0 deletions internal/tsoptions/commandlineparser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ func TestCommandLineParseResult(t *testing.T) {
}
}

func TestParseCommandLineEmptyResponseFile(t *testing.T) {
t.Parallel()

host := tsoptionstest.NewVFSParseConfigHost(map[string]string{}, "/home/project", true)
cmdLine := tsoptions.ParseCommandLine([]string{"@"}, host)

assert.Assert(t, len(cmdLine.Errors) > 0, "expected a diagnostic error for bare '@' argument")
}

func TestParseCommandLineTypeRootsRelativePath(t *testing.T) {
t.Parallel()

Expand Down
Loading