Skip to content

catb0t/exercism.factor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 

Repository files navigation

exercism.factor

interacting with Exercism.io from Factor


exercism.testing

making it easy for end users and maintainers alike to unit-test Factor code on Exercism.io

Rationale

Factor and Exercism both have rather strict naming conventions which make a consistent and simple unit test interface tricky.

This vocabulary allows end users to run the same unit tests on their code that factor maintainers do, with a consistent interface.

Getting started

  1. Install a 0.98 nightly build (0.97 stable will not work!!) from [factorcode.org]factorcode (the "Development release" section for your OS and arch), or build directly from source

  2. Clone or download the repository, and copy the exercism folder to resource:work1.

  3. Open a shell (bash, cmd.exe, Powershell, etc) and run the following from your exercism/factor Exercism directory or factor clone:

factor -run=exercism.testing run-all

Or, from a Factor listener instance:

IN: scratchpad USING: io.directories exercism.testing ;
IN: scratchpad "place/you/want/to/test" [ run-all-exercism-tests ] with-directory

If you get something like Vocabulary does not exist, then Factor couldn't find exercism.testing. Make sure it's within Factor's resource paths. Otherwise, you should see something like:

working directory OK: /home/you/exercism/factor is a user-env
config OK: all problems have implementations and unit tests

testing exercise: hello-world

Unit Test: { { "Hello, World!" } [ "" hello-name ] }
Unit Test: { { "Hello, Alice!" } [ "Alice" hello-name ] }
Unit Test: { { "Hello, Bob!" } [ "Bob" hello-name ] }

Viola!

1 Refers to the work subfolder of Factor's installation directory. If Factor's installation directory is /home/you/factor, resource:work refers to /home/you/factor/work.


Check out exercism.testing's documentation for more information.

If you need help, just open an issue here or on factor.

About

Making it easy to unit-test Factor code on Exercism

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published