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

Allow lazily-evaluated code as argument to TEST #3490

Draft
wants to merge 18 commits into
base: development
Choose a base branch
from

Commits on Sep 28, 2024

  1. Store operator in functionCode objects

    This way, we can recognize when when is a test
    d-torrance committed Sep 28, 2024
    Configuration menu
    Copy the full SHA
    692f9e9 View commit details
    Browse the repository at this point in the history
  2. Add new type of operator ("thunk") for creating nullary functions

    TEST will be one.  Parsed as an Arrow with a dummy lhs
    d-torrance committed Sep 28, 2024
    Configuration menu
    Copy the full SHA
    a5f6300 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e2e1e1d View commit details
    Browse the repository at this point in the history
  4. Update behavior of TEST keyword

    Now creates a nullary function containing the test's code rather than
    just computing the location of the string.
    d-torrance committed Sep 28, 2024
    Configuration menu
    Copy the full SHA
    357b426 View commit details
    Browse the repository at this point in the history
  5. Make TestInput (now TestClosure) a child of FunctionClosure

    We get most of the desired methods for free via inheritance.
    
    We keep TestInput around as a synonym for now
    d-torrance committed Sep 28, 2024
    Configuration menu
    Copy the full SHA
    3656742 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    54f727d View commit details
    Browse the repository at this point in the history
  7. Adapt "check" for tests as functions

    We call each test, and if it returns a string, then it's a traditional test
    that we should try to capture.  Otherwise, we're done!
    
    A couple things:
    
    - Tests run this way don't produce any output, so debugging is harder.  In
      particular, Verbose => true doesn't do anything.
    - We print "calling" *after* we're done running the test, since we don't know
      if it returns a string or not.
    d-torrance committed Sep 28, 2024
    Configuration menu
    Copy the full SHA
    ad8384b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8448e54 View commit details
    Browse the repository at this point in the history
  9. Update capture(TestClosure) for new test behavior

    Run a test, and if it returns a string (i.e., it's a traditional
    test), then capture that string.
    d-torrance committed Sep 28, 2024
    Configuration menu
    Copy the full SHA
    87361bd View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2024

  1. Configuration menu
    Copy the full SHA
    c43056b View commit details
    Browse the repository at this point in the history
  2. Adapt packages that use "TEST get(...)" for new test behavior

    currentFileDirectory will no likely no longer be the correct path to
    the test files, so we use the packages' "auxiliary files" keys to find
    them.
    d-torrance committed Sep 29, 2024
    Configuration menu
    Copy the full SHA
    5772ffc View commit details
    Browse the repository at this point in the history
  3. Convert TerraciniLoci tests to functions as proof of concept

    Also bump package to version 0.2
    d-torrance committed Sep 29, 2024
    Configuration menu
    Copy the full SHA
    5be1c7b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0318cec View commit details
    Browse the repository at this point in the history
  5. Don't capture examples with TEST keyword

    Otherwise we'll actually add a test to the current package.
    d-torrance committed Sep 29, 2024
    Configuration menu
    Copy the full SHA
    00af1af View commit details
    Browse the repository at this point in the history
  6. Update TEST doc with new behavior

    Also add "tests" to SeeAlso section
    d-torrance committed Sep 29, 2024
    Configuration menu
    Copy the full SHA
    5d46294 View commit details
    Browse the repository at this point in the history
  7. Add TestFiles option to newPackage

    List of files to install in package test directory when running
    installPackage.
    d-torrance committed Sep 29, 2024
    Configuration menu
    Copy the full SHA
    44f6447 View commit details
    Browse the repository at this point in the history
  8. Use TestFiles option in JSON package

    Also bump the version number of JSON
    d-torrance committed Sep 29, 2024
    Configuration menu
    Copy the full SHA
    c8efd14 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    93c1355 View commit details
    Browse the repository at this point in the history