<commit_before>package com.getkeepsafe.dexcount;

import spock.lang.Specification

class DexFileTest extends Specification {
    def "test AAR dexcount"() {
        setup:
        def currentDir = new File(".").getAbsolutePath()

        when:
        def aarFile = new File(currentDir + File.separatorChar + "src"
                + File.separatorChar + "test" + File.separatorChar + "resources"
                + File.separatorChar + "android-beacon-library-2.7.aar")
        if (!aarFile.exists()) {
            // couldn't read directly off file system if we're in a jar, so pull resources and drop them into a temp file
            // This is for TravisCI, specifically
            aarFile = File.createTempFile("test", ".aar")
            aarFile.deleteOnExit()
            def buf = new byte[4096]
            Thread.currentThread().getContextClassLoader().getResourceAsStream('android-beacon-library-2.7.aar').withStream { input ->
                aarFile.withOutputStream { output ->
                    def read
                    while ((read = input.read(buf)) != -1) {
                        output.write(buf, 0, read)
                    }
                    output.flush()
                }
            }<commit_msg>add stuff back in that should make no difference but at least Travis built once with it<commit_after>package com.getkeepsafe.dexcount;

import spock.lang.Specification

class DexFileTest extends Specification {
    def "test AAR dexcount"() {
        setup:
        def currentDir = new File(".").getAbsolutePath()

        when:
        def aarFile = new File(currentDir + File.separatorChar + "src"
                + File.separatorChar + "test" + File.separatorChar + "resources"
                + File.separatorChar + "android-beacon-library-2.7.aar")
        def url = Thread.currentThread().getContextClassLoader().getResource("./")
        def files = new File(url.toURI()).listFiles()
        for (file in files) {
            println(file.absolutePath)
        }
        if (!aarFile.exists()) {
            // couldn't read directly off file system if we're in a jar, so pull resources and drop them into a temp file
            // This is for TravisCI, specifically
            aarFile = File.createTempFile("test", ".aar")
            aarFile.deleteOnExit()
            def buf = new byte[4096]
            Thread.currentThread().getContextClassLoader().getResourceAsStream('android-beacon-library-2.7.aar').withStream { input ->
                aarFile.withOutputStream { output ->
                    def read
                    while ((read = input.read(buf)) != -1) {
                        output.write(buf, 0, read)
                    }
                    output.flush()
                }
            }
{'fraction_non_alphanumeric': 0.10595065312046444, 'fraction_numerical': 0.00725689404934688, 'mean_word_length': 1.8335046248715314, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7318972', 'n_tokens_mistral': 759, 'n_tokens_neox': 710, 'n_words': 188}