コード例 #1
0
            private void VerifyReplace(VimRegexOptions options, string pattern, string input, string replace, string result)
            {
                var regex = VimRegexFactory.Create(pattern, options);

                Assert.True(regex.IsSome());

                var noMagic     = VimRegexOptions.NoMagic == (options & VimRegexOptions.NoMagic);
                var replaceData = new VimRegexReplaceData(Environment.NewLine, !noMagic, VimRegexReplaceCount.All);

                Assert.Equal(result, regex.Value.Replace(input, replace, replaceData));
            }
コード例 #2
0
ファイル: VimRegexTest.cs プロジェクト: Kazark/VsVim
            private void VerifyReplace(VimRegexOptions options, string pattern, string input, string replace, string result, VimRegexReplaceCount count = null)
            {
                count = count ?? VimRegexReplaceCount.All;
                var regex = VimRegexFactory.Create(pattern, options);
                Assert.True(regex.IsSome());

                var noMagic = VimRegexOptions.NoMagic == (options & VimRegexOptions.NoMagic);
                var replaceData = new VimRegexReplaceData(Environment.NewLine, !noMagic, count);
                Assert.Equal(result, regex.Value.Replace(input, replace, replaceData, _registerMap));
            }