<commit_before>
#include <stdio.h>
#include <assert.h>
#include "../mill.h"

void foo(chan ch) {
    yield();
    chs(ch, (void*)333);
    chclose(ch); 
}

int main() {
    chan ch = chmake();
    go(foo(ch));
    void *val = chr(ch);
    assert(val == (void*)333);
    chclose(ch);
    return 0;
}
<commit_msg>chan test improved<commit_after>
#include <stdio.h>
#include <assert.h>
#include "../mill.h"

void sender(chan ch, int doyield, void *val) {
    if(doyield)
        yield();
    chs(ch, val);
    chclose(ch); 
}

int main() {
    chan ch;
    void *val;

    /* Receiver waits for sender. */
    ch = chmake();
    go(sender(ch, 1, (void*)333));
    val = chr(ch);
    assert(val == (void*)333);
    chclose(ch);

    /* Sender waits for receiver. */
    ch = chmake();
    go(sender(ch, 0, (void*)444));
    val = chr(ch);
    assert(val == (void*)444);
    chclose(ch);

    return 0;
}

{'fraction_non_alphanumeric': 0.19777777777777777, 'fraction_numerical': 0.024444444444444446, 'mean_word_length': 2.604, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5059641', 'n_tokens_mistral': 375, 'n_tokens_neox': 346, 'n_words': 85}