haskell / haskell/cabal

--test-options are split wrong

Open
#8,090 1 comment 1 reaction 0 assignees View on GitHub
attention: pr-welcome cabal-install: cmd/test type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**
cabal's test-options botches the arguments before it passes them to the test executable

**To Reproduce**
Clone cabal repo, and run the following command

```
cabal v2-test integration-tests2 --test-options '-p "find root"'
```
it should work fine, however the below command doesn't

```
cabal v2-test integration-tests2 --test-options "-p 'find root'"
```

**Expected behavior**
Both methods of passing the arguments should work.

**System information**
- Operating system: nixos
- `cabal`, `ghc` versions: 3.6.2.0, 8.10.7

**Additional context**
Did some investigation, and that the bug is in the `splitArgs` function
```haskell
> splitArgs "-p 'find root'"
["-p","'find","root'"]
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.