<commit_before>package com.github.jeysal.intellij.plugin.livetemplate.scriptenginemacro.conversion.param

import com.intellij.codeInsight.template.Result
import spock.lang.Specification

/**
 * @author seckinger
 * @since 10/24/16
 */
class ParamConverterTest extends Specification {
    def conv = new ParamConverter()

    def 'toStrings any Result'() {
        given:
        def res = Mock(Result)

        expect:
        conv.call(res) == res.toString()
    }

    def 'toStrings null'() {
        expect:
        conv.call(null) == 'null'
    }
}<commit_msg>add InvokeActionResultParamConverter test<commit_after>package com.github.jeysal.intellij.plugin.livetemplate.scriptenginemacro.conversion.param

import com.intellij.codeInsight.template.InvokeActionResult
import com.intellij.codeInsight.template.Result
import spock.lang.Specification

/**
 * @author seckinger
 * @since 10/24/16
 */
class ParamConverterTest extends Specification {
    def conv = new ParamConverter()

    def 'unwraps an InvokeActionsResult'() {
        given:
        Runnable noop = { -> }

        expect:
        conv.call(new InvokeActionResult(noop)) == noop
    }

    def 'toStrings any Result'() {
        given:
        def res = Mock(Result)

        expect:
        conv.call(res) == res.toString()
    }

    def 'toStrings null'() {
        expect:
        conv.call(null) == 'null'
    }
}
{'fraction_non_alphanumeric': 0.11231101511879049, 'fraction_numerical': 0.008639308855291577, 'mean_word_length': 2.850415512465374, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '146822', 'n_tokens_mistral': 449, 'n_tokens_neox': 435, 'n_words': 85}