<commit_before>import ceylon.language.meta { modules }

@test
shared void testResources() {
    assert(exists mod = modules.find("default","unversioned"));
    value res1 = mod.resourceByPath("resource.txt");
    value res2 = mod.resourceByPath("/resource.txt");
    check(res1 exists, "resource by relative path");
    check(res2 exists, "resource by full path");
    assert(exists r1=res1, exists r2=res2);
    check("/" in r1.uri, "resource uri 1");
    check(r1.uri.startsWith("file:/"), "resource uri 2");
    check(!"\\" in r1.uri, "resource uri 3");
    check(r1.name=="resource.txt", "resource name 1");
    check(r1.name==r2.name, "resource name 2");
    check(r1.size==15, "resource size 1");
    check(r2.size==r1.size, "resource size 2");
    value txt = r1.textContent();
    check(txt=="A resource test", "resource content");
    //Now for something inside a CAR
    if (runtime.name=="jvm") {
        if (exists carr = mod.resourceByPath("/META-INF/mapping.txt")) {
            check(carr.name=="mapping.txt", "car resource name");
            check(carr.uri.endsWith("!META-INF/mapping.txt"), "car resource uri 1");
            check(carr.uri.startsWith("file:/"), "car resource uri 2");
            check(carr.size>1000, "car resource size");
            check(carr.textContent().size==carr.size, "car resource content");
        } else {
            fail("Couldn't find mapping.txt file in default.car using absolute path");
        }
        if (exists carr = mod.resourceByPath("META-INF/mapping.txt")) {
        } else {
            fail("Couldn't find mapping.txt file in default.car using relative path");
        }
    }
}
<commit_msg>Fixed the resource tests now that their URIs have changed slightly<commit_after>import ceylon.language.meta { modules }

@test
shared void testResources() {
    assert(exists mod = modules.find("default","unversioned"));
    value res1 = mod.resourceByPath("resource.txt");
    value res2 = mod.resourceByPath("/resource.txt");
    check(res1 exists, "resource by relative path");
    check(res2 exists, "resource by full path");
    assert(exists r1=res1, exists r2=res2);
    check("/" in r1.uri, "resource uri 1");
    check(r1.uri.startsWith("classpath:/"), "resource uri 2");
    check(!"\\" in r1.uri, "resource uri 3");
    check(r1.name=="resource.txt", "resource name 1");
    check(r1.name==r2.name, "resource name 2");
    check(r1.size==15, "resource size 1");
    check(r2.size==r1.size, "resource size 2");
    value txt = r1.textContent();
    check(txt=="A resource test", "resource content");
    //Now for something inside a CAR
    if (runtime.name=="jvm") {
        if (exists carr = mod.resourceByPath("/META-INF/mapping.txt")) {
            check(carr.name=="mapping.txt", "car resource name");
            check(carr.uri.endsWith("!META-INF/mapping.txt"), "car resource uri 1");
            check(carr.uri.startsWith("classpath:/"), "car resource uri 2");
            check(carr.size>1000, "car resource size");
            check(carr.textContent().size==carr.size, "car resource content");
        } else {
            fail("Couldn't find mapping.txt file in default.car using absolute path");
        }
        if (exists carr = mod.resourceByPath("META-INF/mapping.txt")) {
        } else {
            fail("Couldn't find mapping.txt file in default.car using relative path");
        }
    }
}

{'fraction_non_alphanumeric': 0.1608991422656019, 'fraction_numerical': 0.019520851818988466, 'mean_word_length': 3.0796139927623645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3476022', 'n_tokens_mistral': 1089, 'n_tokens_neox': 1047, 'n_words': 270}