Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request: editing out tests should write them as test watch expressions #1745

Closed
samgqroberts opened this issue Nov 6, 2020 · 1 comment
Closed

Comments

@samgqroberts
Copy link
Contributor

This probably doesn't need as much contextualization as I'm about to give but you know what clarity is important :)

I can add a function with tests to my codebase like this:

addTwo x = x + 2
test> addTwo.tests.example1 = check (addTwo 1 == 3)
test> addTwo.tests.example2 = check (addTwo 4 == 6)

and then if I edit them back out:

.scratch> ls

  1. addTwo  (Nat -> Nat)
  2. addTwo/ (2 definitions)

.scratch> ls 2

  1. tests/ (2 definitions)

.scratch> ls 1

  1. example1 ([Result])
  2. example2 ([Result])

.scratch> edit 1 2

  ☝️
  
  I added these definitions to the top of /home/sam/rummikub/scratch.u
  
    addTwo.tests.example1 : [Result]
    addTwo.tests.example1 = check (addTwo 1 == 3)
    
    addTwo.tests.example2 : [Result]
    addTwo.tests.example2 = check (addTwo 4 == 6)
  
  You can edit them there, then do `update` to replace the definitions currently in this namespace.

I get them in a form that does not have the test> watch expression prefix:

addTwo.tests.example1 : [Result]
addTwo.tests.example1 = check (addTwo 1 == 3)

addTwo.tests.example2 : [Result]
addTwo.tests.example2 = check (addTwo 4 == 6

This means that on updates, ucm won't run these tests, although I almost certainly in every situation want it to be doing that, because I want to make sure the tests still pass after I complete whatever refactor I'm doing.

@samgqroberts
Copy link
Contributor Author

@mitchellwrosen I believe you fixed this with #3716, going ahead and closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant