vocabs.files: adding a 'vocab-tests-path' that doesn't check for existence.

db4
John Benediktsson 2012-07-23 10:01:48 -07:00
parent 6994b0eed8
commit 3a5d7077fb
2 changed files with 11 additions and 4 deletions

View File

@ -1,9 +1,13 @@
USING: help.markup help.syntax strings ;
IN: vocabs.files
HELP: vocab-tests-file
HELP: vocab-tests-path
{ $values { "vocab" "a vocabulary specifier" } { "path" "pathname string to test file" } }
{ $description "Outputs a pathname where the unit test file is located." } ;
{ $description "Outputs a pathname where the unit test file for " { $snippet "vocab" } " is located. Outputs " { $link f } " if the vocabulary does not have a directory on disk." } ;
HELP: vocab-tests-file
{ $values { "vocab" "a vocabulary specifier" } { "path/f" "pathname string to test file" } }
{ $description "Outputs a pathname where the unit test file is located, or " { $link f } " if the file does not exist." } ;
HELP: vocab-tests-dir
{ $values { "vocab" "a vocabulary specifier" } { "paths" "a sequence of pathname strings" } }

View File

@ -4,8 +4,11 @@ USING: io.directories io.files io.pathnames kernel make
sequences vocabs.loader ;
IN: vocabs.files
: vocab-tests-file ( vocab -- path )
dup "-tests.factor" append-vocab-dir vocab-append-path dup
: vocab-tests-path ( vocab -- path )
dup "-tests.factor" append-vocab-dir vocab-append-path ;
: vocab-tests-file ( vocab -- path/f )
vocab-tests-path dup
[ dup exists? [ drop f ] unless ] [ drop f ] if ;
: vocab-tests-dir ( vocab -- paths )