Tests do not compile

Trying to run the tests for Hello World, I am confronted with

.> load hello.test.u

  I'm not sure what Test.expect means at line 5, columns 3-14

      5 |   Test.expect (hello === expected)

  Whatever it is, it has a type that conforms to Boolean -> o.

Am I doing something wrong, or has something gone out of date?

@rlmark

I’ll take a look! Are you running from the command line or from the web portal? Also, if you’re working on the command line, with a local codebase, what version of the base library are you using? The test runner is using M4d.

1 Like

I’m working locally.

Not sure how to check the base library version. ucm --version says You are running version: release/M3 (built on 2022-03-07). This make sense: I clicked the .zip link on the installation instructions page and that url looks version hardcoded.

Ah yes, that’s an older binary. I’ll have that URL direct to our installs page so that the link is always up to date. Thank you for pointing it out!

The older version of the base library which ships with M3 had a slightly different testing namespace structure, so test file (built against a newer version of base) is using functions that your local codebase doesn’t have.

You can update the base library version in your local codebase with these instructions But if you’re working locally, the UCM builds since M3 have some nice improvements so it might be worthwhile to upgrade the UCM itself and then upgrade the base library version. Let me know if I can help or if that causes troubles!

I

  1. Installed UCM again but this time via the instructions on unison-lang.org;
  2. Verified that the tests still would not compile;
  3. Followed the linked instructions for updating dependencies;
    • Was told The namespace lib.base doesn't exist., therefore went with plain base instead;
  4. While verifying that the tests now would compile, was confronted with
    .> load hello.test.u
    
      I couldn't find any definitions matching the name hello inside the namespace .
    
          5 |   Test.expect (hello === expected)
    
      Some common causes of this error include:
        * Your current namespace is too deep to contain the definition in its
      subtree
        * The definition is part of a library which hasn't been added to this
      project
    
      To add a library to this project use the command: `fork <.path.to.lib> .lib.<libname>`
    
      Whatever it is, its type should conform to Text.
    
    Neither add hello.u nor update hello.u nor load hello.u would fix this; I do not (yet) know what that fork would do.

Bringing the above to your attention not because I think I this is a likely obstacle to the track (or at least Hello World – I expect a fresh install to just work, and will check later), but just in case it seems relevant to you to some later point.

1 Like