<commit_before>USING: accessors arrays continuations io.directories io.files.info
io.files.temp io.launcher kernel layouts math sequences system
tools.deploy.backend tools.deploy.config.editor ;
IN: tools.deploy.test

: shake-and-bake ( vocab -- )
    [ "test.image" temp-file delete-file ] ignore-errors
    "resource:" [
        [ vm "test.image" temp-file ] dip
        dup deploy-config make-deploy-image
    ] with-directory ;

: small-enough? ( n -- ? )
    [ "test.image" temp-file file-info size>> ] [ cell 4 / * ] bi* <= ;

: run-temp-image ( -- )
    vm
    "-i=" "test.image" temp-file append
    2array
    <process> swap >>command +closed+ >>stdin try-process ;<commit_msg>tools.deploy.test: use try-output-process, and run VM from .app bundle when testing deployed app. This makes the game-input deploy test work<commit_after>USING: accessors arrays continuations io.directories io.files.info
io.files.temp io.launcher io.backend kernel layouts math sequences system
tools.deploy.backend tools.deploy.config.editor ;
IN: tools.deploy.test

: shake-and-bake ( vocab -- )
    [ "test.image" temp-file delete-file ] ignore-errors
    "resource:" [
        [ vm "test.image" temp-file ] dip
        dup deploy-config make-deploy-image
    ] with-directory ;

: small-enough? ( n -- ? )
    [ "test.image" temp-file file-info size>> ] [ cell 4 / * ] bi* <= ;

: run-temp-image ( -- )
    os macosx?
    "resource:Factor.app/Contents/MacOS/factor" normalize-path vm ?
    "-i=" "test.image" temp-file append 2array try-output-process ;
{'fraction_non_alphanumeric': 0.13804277381723914, 'fraction_numerical': 0.002592352559948153, 'mean_word_length': 3.031331592689295, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 12, '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': '6420080', 'n_tokens_mistral': 509, 'n_tokens_neox': 489, 'n_words': 127}