haskell / haskeline

A Haskell library for line input in command-line programs.
https://hackage.haskell.org/package/haskeline
BSD 3-Clause "New" or "Revised" License
221 stars 75 forks source link

Define executable targets in the cabal file for tests #103

Closed luntain closed 5 years ago

luntain commented 5 years ago

This change is motivated to make it easier to run the unit tests:

one test is failing independent of my changes

Failure in: 0:interaction:2:tab completion:0

tests/RunTTY.hs:106 expected: ["dummy-\206\188\206\177\207\131/\r\nbar \207\130\206\181\207\129\207\132\r\n0:dummy-\206\188\206\177\207\131/"] but got: ["dummy-\206\188\a\a"]


This change is Reviewable

judah commented 5 years ago

I figured out why that test is failing; it's trying to tab-complete the name of the "dummy-μασ" folder in the test/ directory: https://github.com/judah/haskeline/tree/master/tests https://github.com/judah/haskeline/blob/master/tests/Unit.hs#L108

We could either make the test run itself in the test/ subdirectory, or else change the unit test from "dummy-" to "test/dummy-". I believe that would let us turn it back from an executable to a regular test.

luntain commented 5 years ago

Turning the tests from executable to regular test would be good. I don't not how to do it yet. Perhaps create a ticket for it.