<commit_before>// Copyright (c) ppy Pty Ltd <<EMAIL>>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

#nullable disable
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Testing;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Tests.Visual.Gameplay
{
    [HeadlessTest]
    public class TestSceneModValidity : TestSceneAllRulesetPlayers
    {
        protected override void AddCheckSteps()
        {
            AddStep("Check all mod acronyms are unique", () =>
            {
                var mods = Ruleset.Value.CreateInstance().AllMods;

                IEnumerable<string> acronyms = mods.Select(m => m.Acronym);

                Assert.That(acronyms, Is.Unique);
            });

            AddStep("Check all mods are two-way incompatible", () =>
            {
                var mods = Ruleset.Value.CreateInstance().AllMods;

                IEnumerable<Mod> modInstances = mods.Select(mod => mod.CreateInstance());

                foreach (var mod in modInstances)
                {
                    var modIncompatibilities = mod.IncompatibleMods;

                    foreach (var incompatibleModType in modIncompatibilities)
                    {
                        var incompatibleMod = modInstances.First(m => m.GetType().IsInstanceOfType(incompatibleModType));
                        Assert.That(incompatibleMod.IncompatibleMods.Contains(mod.GetType()));
                    }
                }
            });
        }
    }
}<commit_msg>reverse IsInstanceOfType logic<commit_after>// Copyright (c) ppy Pty Ltd <<EMAIL>>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

#nullable disable
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Testing;
using osu.Game.Rulesets.Mods;

namespace osu.Game.Tests.Visual.Gameplay
{
    [HeadlessTest]
    public class TestSceneModValidity : TestSceneAllRulesetPlayers
    {
        protected override void AddCheckSteps()
        {
            AddStep("Check all mod acronyms are unique", () =>
            {
                var mods = Ruleset.Value.CreateInstance().AllMods;

                IEnumerable<string> acronyms = mods.Select(m => m.Acronym);

                Assert.That(acronyms, Is.Unique);
            });

            AddStep("Check all mods are two-way incompatible", () =>
            {
                var mods = Ruleset.Value.CreateInstance().AllMods;

                IEnumerable<Mod> modInstances = mods.Select(mod => mod.CreateInstance());

                foreach (var mod in modInstances)
                {
                    var modIncompatibilities = mod.IncompatibleMods;

                    foreach (var incompatibleModType in modIncompatibilities)
                    {
                        var incompatibleMod = modInstances.First(m => incompatibleModType.IsInstanceOfType(m));
                        Assert.That(incompatibleMod.IncompatibleMods.Contains(mod.GetType()));
                    }
                }
            });
        }
    }
}
{'fraction_non_alphanumeric': 0.0927508705286483, 'fraction_numerical': 0.0, 'mean_word_length': 1.9313543599257885, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, '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': '5624662', 'n_tokens_mistral': 865, 'n_tokens_neox': 816, 'n_words': 188}