<commit_before>USING: bootstrap.image tools.test system io io.encodings.ascii
io.pathnames io.files io.files.info io.files.temp kernel
tools.deploy.config tools.deploy.config.editor
tools.deploy.backend math sequences io.launcher arrays
namespaces continuations layouts accessors urls math.parser
io.directories tools.deploy tools.deploy.test vocabs ;

IN: tools.deploy.tests

! Delete all cached staging images in case syntax or
! other core vocabularies have changed and staging
! images are stale.
cache-directory [
    [ "staging." head? ] filter
    my-arch ".image" append [ tail? ] curry filter
    [ delete-file ] each
] with-directory-files

[ "nosuchvocab" deploy ] [ no-vocab? ] must-fail-with

[ "no such vocab, fool!" deploy ] [ bad-vocab-name? ] must-fail-with

[ ] [ "hello-world" shake-and-bake 500000 small-enough? ] unit-test

[ ] [ "sudoku" shake-and-bake 800000 small-enough? ] unit-test

[ ] [ "hello-ui" shake-and-bake 1300000 small-enough? ] unit-test<commit_msg>tools.deploy: use splitting, sigh.<commit_after>USING: bootstrap.image tools.test system io io.encodings.ascii
io.pathnames io.files io.files.info io.files.temp kernel
tools.deploy.config tools.deploy.config.editor
tools.deploy.backend math sequences io.launcher arrays
namespaces continuations layouts accessors urls math.parser
io.directories splitting tools.deploy tools.deploy.test vocabs ;

IN: tools.deploy.tests

! Delete all cached staging images in case syntax or
! other core vocabularies have changed and staging
! images are stale.
cache-directory [
    [ "staging." head? ] filter
    my-arch ".image" append [ tail? ] curry filter
    [ delete-file ] each
] with-directory-files

[ "nosuchvocab" deploy ] [ no-vocab? ] must-fail-with

[ "no such vocab, fool!" deploy ] [ bad-vocab-name? ] must-fail-with

[ ] [ "hello-world" shake-and-bake 500000 small-enough? ] unit-test

[ ] [ "sudoku" shake-and-bake 800000 small-enough? ] unit-test

[ ] [ "hello-ui" shake-and-bake 1300000 small-enough? ] unit-test
{'fraction_non_alphanumeric': 0.11582626060908637, 'fraction_numerical': 0.018971542685971045, 'mean_word_length': 4.125319693094629, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3854043', 'n_tokens_mistral': 708, 'n_tokens_neox': 640, 'n_words': 179}