<commit_before>namespace Boo.OMeta.Parser.Tests

import System.IO

import Boo.Lang.Compiler.Ast
import Boo.OMeta
import Boo.OMeta.Parser
import Boo.PatternMatching

import NUnit.Framework

partial class BooParserTestFixture:

	def runTestCase(fname as string):
		
		fullName = Path.Combine(booRoundtripTestCasesPath(), fname)
		
		parser = BooParser()
		match parser.module(File.ReadAllText(fullName)):
			case SuccessfulMatch(Value: m=Module()):
				assert m is not null
				assert m.Documentation is not null
				Assert.AreEqual(normalize(m.Documentation), normalize(m.ToCodeString()))
						
	def normalize(s as string):
		return s.Trim().Replace("\r\n", "\n")
		
	def booRoundtripTestCasesPath():
		
		return Path.Combine(
					findSiblingBooDirectory(parentDirectory(System.Environment.CurrentDirectory)),<commit_msg>tighter condition for the test case<commit_after>namespace Boo.OMeta.Parser.Tests

import System.IO

import Boo.Lang.Compiler.Ast
import Boo.OMeta
import Boo.OMeta.Parser
import Boo.PatternMatching

import NUnit.Framework

partial class BooParserTestFixture:

	def runTestCase(fname as string):
		
		fullName = Path.Combine(booRoundtripTestCasesPath(), fname)
		
		parser = BooParser()
		match parser.module(File.ReadAllText(fullName)):
			case SuccessfulMatch(Input: OMetaInput(IsEmpty: true), Value: m=Module()):
				assert m is not null
				assert m.Documentation is not null
				Assert.AreEqual(normalize(m.Documentation), normalize(m.ToCodeString()))
						
	def normalize(s as string):
		return s.Trim().Replace("\r\n", "\n")
		
	def booRoundtripTestCasesPath():
		
		return Path.Combine(
					findSiblingBooDirectory(parentDirectory(System.Environment.CurrentDirectory)),
{'fraction_non_alphanumeric': 0.10294117647058823, 'fraction_numerical': 0.0, 'mean_word_length': 4.885813148788928, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1086791', 'n_tokens_mistral': 614, 'n_tokens_neox': 525, 'n_words': 117}