Skip to content

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

Description

@samgqroberts

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions