<commit_before>/*******************************************************************************
 *  Copyright (c) 2016 ModelSolv, Inc. and others.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *  
 *  Contributors:
 *     ModelSolv, Inc. - initial API and implementation and/or initial documentation
 *******************************************************************************/
package com.reprezen.swagedit.openapi3.assist

import com.google.common.base.Charsets
import java.io.File
import java.io.FilenameFilter
import java.nio.file.Files
import java.nio.file.Paths
import java.util.ArrayList
import java.util.Collection
import java.util.List
import java.util.regex.Pattern
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
import org.junit.runners.Parameterized.Parameter

@RunWith(typeof(Parameterized))
abstract class CodeAssistContextTest {
	
	val static testNamePattern = Pattern::compile(".*name=\"([\\w\\s/]+)\".*")
	val protected static refValuePattern = Pattern::compile(".*value=\"([\\w\\s/]+)\".*")

	def static protected Collection<Object[]> data(File resourcesDir, String contextMarker) {
		val specFiles = resourcesDir.listFiles(new FilenameFilter() {

			override accept(File dir, String name) {
				name.endsWith(".yaml")<commit_msg>#289 - expand regex in test parser<commit_after>/*******************************************************************************
 *  Copyright (c) 2016 ModelSolv, Inc. and others.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *  
 *  Contributors:
 *     ModelSolv, Inc. - initial API and implementation and/or initial documentation
 *******************************************************************************/
package com.reprezen.swagedit.openapi3.assist

import com.google.common.base.Charsets
import java.io.File
import java.io.FilenameFilter
import java.nio.file.Files
import java.nio.file.Paths
import java.util.ArrayList
import java.util.Collection
import java.util.List
import java.util.regex.Pattern
import org.junit.runner.RunWith
import org.junit.runners.Parameterized
import org.junit.runners.Parameterized.Parameter

@RunWith(typeof(Parameterized))
abstract class CodeAssistContextTest {
	
	val static testNamePattern = Pattern::compile(".*name=\"([\\w\\s/]+)\".*")
	val protected static refValuePattern = Pattern::compile(".*value=\"([\\w\\s./]+)\".*")

	def static protected Collection<Object[]> data(File resourcesDir, String contextMarker) {
		val specFiles = resourcesDir.listFiles(new FilenameFilter() {

			override accept(File dir, String name) {
				name.endsWith(".yaml")
{'fraction_non_alphanumeric': 0.2101206434316354, 'fraction_numerical': 0.0070375335120643435, 'mean_word_length': 5.231732776617954, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4050455', 'n_tokens_mistral': 826, 'n_tokens_neox': 775, 'n_words': 214}