<commit_before>﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.IO;

namespace Gamefloor.Support
{
    public class AssertHelper
    {
        public static void Assert(bool condition, String message)
        {
            if (!condition) try
            {
                using (StreamWriter s = File.CreateText("assert.log"))
                {
                    s.Write("Assert failed: ");
                    s.WriteLine(message);
                    s.Write("Date: ");
                    s.WriteLine(DateTime.Now.ToString("G"));
                    s.Write("Stack trace: ");
                    s.WriteLine(new StackTrace(true).ToString());
                    s.WriteLine();
                }
            }
            catch (Exception)
            {
                // directory not found or no write permissions there
            }

            Debug.Assert(condition, message);
        }
    }
}<commit_msg>Added AssertHelper.Unreachable() convenience.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using System.IO;

namespace Gamefloor.Support
{
    public class AssertHelper
    {
        public static void Assert(bool condition, String message)
        {
            if (!condition) try
            {
                using (StreamWriter s = File.CreateText("assert.log"))
                {
                    s.Write("Assert failed: ");
                    s.WriteLine(message);
                    s.Write("Date: ");
                    s.WriteLine(DateTime.Now.ToString("G"));
                    s.Write("Stack trace: ");
                    s.WriteLine(new StackTrace(true).ToString());
                    s.WriteLine();
                }
            }
            catch (Exception)
            {
                // directory not found or no write permissions there
            }

            Debug.Assert(condition, message);
        }

        public void Unreachable()
        {
            Assert(false, "Unreachable code has been reached.");
        }
    }
}
{'fraction_non_alphanumeric': 0.10123574144486693, 'fraction_numerical': 0.0, 'mean_word_length': 1.3866213151927438, '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': '6576303', 'n_tokens_mistral': 503, 'n_tokens_neox': 478, 'n_words': 113}