<commit_before>using Xunit;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Management.Automation;
using System.Management.Automation.Host;
using System.Management.Automation.Internal;
using System.Management.Automation.Internal.Host;
using System.Management.Automation.Provider;
using System.Management.Automation.Runspaces;
using Microsoft.PowerShell;
using Microsoft.PowerShell.Commands;
using Microsoft.PowerShell.Linux.Host;

namespace PSTests
{
    [Collection("AssemblyLoadContext")]
    public class FileSystemProviderTests: IDisposable
    {
		private string testPath;
		private string testContent;
		public FileSystemProviderTests()
		{
			testPath = Path.Combine(Path.GetTempPath(),"test");
			testContent = "test content!";
			if(File.Exists(testPath)) File.Delete(testPath);
			File.AppendAllText(testPath,testContent);
		}
		void IDisposable.Dispose()
		{
			File.Delete(testPath);
		}
		
		private ExecutionContext GetExecutionContext()
		{
			CultureInfo currentCulture = CultureInfo.CurrentCulture;
            PSHost hostInterface =  new DefaultHost(currentCulture,currentCulture);
            RunspaceConfiguration runspaceConfiguration =  RunspaceConfiguration.Create();
            InitialSessionState iss = InitialSessionState.CreateDefault2();
            AutomationEngine engine = new AutomationEngine(hostInterface, runspaceConfiguration, iss);
            ExecutionContext executionContext = new ExecutionContext(engine, hostInterface, iss);
			return executionContext;
		}
		private ProviderInfo GetProvider()
        {
            ExecutionContext executionContext = GetExecutionContext();
            SessionStateInternal sessionState = new SessionStateInternal(executionContext);
			
			SessionStateProviderEntry providerEntry = new SessionStateProviderEntry("FileSystem",typeof(FileSystemProvider), null);
			sessionState.AddSessionStateEntry(providerEntry);
            ProviderInfo matchingProvider = sessionState.ProviderList.ToList()[0];

            return matchingProvider;
        }
		
        [Fact]
        public void TestCreateJunctionFails()
        {
            Assert.False(InternalSymbolicLinkLinkCodeMethods.CreateJunction("",""));
        }
		
		[Fact]
        public void TestGetHelpMaml()
        {
			FileSystemProvider fileSystemProvider = new FileSystemProvider();
			Assert.Equal(fileSystemProvider.GetHelpMaml(String.Empty,String.Empty),String.Empty);
			Assert.Equal(fileSystemProvider.GetHelpMaml("helpItemName",String.Empty),String.Empty);
			Assert.Equal(fileSystemProvider.GetHelpMaml(String.Empty,"path"),String.Empty);
        }
		
		[Fact]
        public void TestMode()
        {
			Assert.Equal(FileSystemProvider.Mode(null),String.Empty);
			FileSystemInfo directoryObject = new DirectoryInfo(@"/");
			FileSystemInfo fileObject = new FileInfo(@"/etc/hosts");
			FileSystemInfo excutableObject = new FileInfo(@"/bin/echo");
			Assert.Equal(FileSystemProvider.Mode(PSObject.AsPSObject(directoryObject)).Replace("r","-"),"d-r---".Replace("r","-"));
			Assert.Equal(FileSystemProvider.Mode(PSObject.AsPSObject(fileObject)),"------");
			Assert.Equal(FileSystemProvider.Mode(PSObject.AsPSObject(excutableObject)),"------");
        }
		<commit_msg>Fix travis fail with different Mode format in special machine for FileSytemProvider xunit test<commit_after>using Xunit;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Management.Automation;
using System.Management.Automation.Host;
using System.Management.Automation.Internal;
using System.Management.Automation.Internal.Host;
using System.Management.Automation.Provider;
using System.Management.Automation.Runspaces;
using Microsoft.PowerShell;
using Microsoft.PowerShell.Commands;
using Microsoft.PowerShell.Linux.Host;

namespace PSTests
{
    [Collection("AssemblyLoadContext")]
    public class FileSystemProviderTests: IDisposable
    {
		private string testPath;
		private string testContent;
		public FileSystemProviderTests()
		{
			testPath = Path.Combine(Path.GetTempPath(),"test");
			testContent = "test content!";
			if(File.Exists(testPath)) File.Delete(testPath);
			File.AppendAllText(testPath,testContent);
		}
		void IDisposable.Dispose()
		{
			File.Delete(testPath);
		}
		
		private ExecutionContext GetExecutionContext()
		{
			CultureInfo currentCulture = CultureInfo.CurrentCulture;
            PSHost hostInterface =  new DefaultHost(currentCulture,currentCulture);
            RunspaceConfiguration runspaceConfiguration =  RunspaceConfiguration.Create();
            InitialSessionState iss = InitialSessionState.CreateDefault2();
            AutomationEngine engine = new AutomationEngine(hostInterface, runspaceConfiguration, iss);
            ExecutionContext executionContext = new ExecutionContext(engine, hostInterface, iss);
			return executionContext;
		}
		private ProviderInfo GetProvider()
        {
            ExecutionContext executionContext = GetExecutionContext();
            SessionStateInternal sessionState = new SessionStateInternal(executionContext);
			
			SessionStateProviderEntry providerEntry = new SessionStateProviderEntry("FileSystem",typeof(FileSystemProvider), null);
			sessionState.AddSessionStateEntry(providerEntry);
            ProviderInfo matchingProvider = sessionState.ProviderList.ToList()[0];

            return matchingProvider;
        }
		
        [Fact]
        public void TestCreateJunctionFails()
        {
            Assert.False(InternalSymbolicLinkLinkCodeMethods.CreateJunction("",""));
        }
		
		[Fact]
        public void TestGetHelpMaml()
        {
			FileSystemProvider fileSystemProvider = new FileSystemProvider();
			Assert.Equal(fileSystemProvider.GetHelpMaml(String.Empty,String.Empty),String.Empty);
			Assert.Equal(fileSystemProvider.GetHelpMaml("helpItemName",String.Empty),String.Empty);
			Assert.Equal(fileSystemProvider.GetHelpMaml(String.Empty,"path"),String.Empty);
        }
		
		[Fact]
        public void TestMode()
        {
			Assert.Equal(FileSystemProvider.Mode(null),String.Empty);
			FileSystemInfo directoryObject = new DirectoryInfo(@"/");
			FileSystemInfo fileObject = new FileInfo(@"/etc/hosts");
			FileSystemInfo excutableObject = new FileInfo(@"/bin/echo");
			Assert.Equal(FileSystemProvider.Mode(PSObject.AsPSObject(directoryObject)).Replace("r","-"),"d-----");
			Assert.Equal(FileSystemProvider.Mode(PSObject.AsPSObject(fileObject)).Replace("r","-"),"------");
			Assert.Equal(FileSystemProvider.Mode(PSObject.AsPSObject(excutableObject)).Replace("r","-"),"------");
        }
		
{'fraction_non_alphanumeric': 0.10637037037037037, 'fraction_numerical': 0.0005925925925925926, 'mean_word_length': 4.448748991121873, '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': '116226', 'n_tokens_mistral': 1908, 'n_tokens_neox': 1740, 'n_words': 303}