Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 67078200BAD for ; Mon, 10 Oct 2016 18:00:30 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 62954160AF1; Mon, 10 Oct 2016 16:00:30 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B0F5B160AD1 for ; Mon, 10 Oct 2016 18:00:29 +0200 (CEST) Received: (qmail 9289 invoked by uid 500); 10 Oct 2016 16:00:28 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 9265 invoked by uid 99); 10 Oct 2016 16:00:28 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Oct 2016 16:00:28 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B14CEE04AF; Mon, 10 Oct 2016 16:00:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sboikov@apache.org To: commits@ignite.apache.org Date: Mon, 10 Oct 2016 16:00:28 -0000 Message-Id: <9e65cd9340084ae8b9d1078dcabd920a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [01/34] ignite git commit: IGNITE-3970 .NET: Fix Cyrillic 'C' letters in code - add test archived-at: Mon, 10 Oct 2016 16:00:30 -0000 Repository: ignite Updated Branches: refs/heads/ignite-comm-opts2 35ea9ea8e -> a85f2ea42 IGNITE-3970 .NET: Fix Cyrillic 'C' letters in code - add test Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/d643dcf2 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/d643dcf2 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/d643dcf2 Branch: refs/heads/ignite-comm-opts2 Commit: d643dcf2dd2caac4c3ff04cb72f31bbfbf97339a Parents: daf974d Author: Pavel Tupitsyn Authored: Wed Sep 28 14:34:23 2016 +0300 Committer: Pavel Tupitsyn Committed: Wed Sep 28 14:34:23 2016 +0300 ---------------------------------------------------------------------- .../ProjectFilesTest.cs | 37 +++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/d643dcf2/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ProjectFilesTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ProjectFilesTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ProjectFilesTest.cs index 75167b5..a030bf2 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ProjectFilesTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ProjectFilesTest.cs @@ -18,6 +18,7 @@ namespace Apache.Ignite.Core.Tests { using System; + using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; @@ -37,11 +38,7 @@ namespace Apache.Ignite.Core.Tests var projFiles = GetDotNetSourceDir().GetFiles("*.csproj", SearchOption.AllDirectories); Assert.GreaterOrEqual(projFiles.Length, 7); - var invalidFiles = - projFiles.Where(x => !File.ReadAllText(x.FullName).Contains("ToolsVersion=\"4.0\"")).ToArray(); - - Assert.AreEqual(0, invalidFiles.Length, - "Invalid csproj files: " + string.Join(", ", invalidFiles.Select(x => x.FullName))); + CheckFiles(projFiles, x => !x.Contains("ToolsVersion=\"4.0\""), "Invalid csproj files: "); } /// @@ -53,17 +50,31 @@ namespace Apache.Ignite.Core.Tests var slnFiles = GetDotNetSourceDir().GetFiles("*.sln", SearchOption.AllDirectories); Assert.GreaterOrEqual(slnFiles.Length, 2); - var invalidFiles = - slnFiles.Where(x => - { - var text = File.ReadAllText(x.FullName); + CheckFiles(slnFiles, x => !x.Contains("# Visual Studio 2010") || + !x.Contains("Microsoft Visual Studio Solution File, Format Version 11.00"), + "Invalid sln files: "); + } - return !text.Contains("# Visual Studio 2010") || - !text.Contains("Microsoft Visual Studio Solution File, Format Version 11.00"); - }).ToArray(); + /// + /// Tests that there are no Cyrillic C instead of English C (which are on the same keyboard key). + /// + [Test] + public void TestCyrillicChars() + { + var srcFiles = GetDotNetSourceDir().GetFiles("*.cs", SearchOption.AllDirectories); + + CheckFiles(srcFiles, x => x.Contains('\u0441') || x.Contains('\u0421'), "Files with Cyrillic 'C': "); + } + + /// + /// Checks the files. + /// + private static void CheckFiles(IEnumerable files, Func isInvalid, string errorText) + { + var invalidFiles = files.Where(x => isInvalid(File.ReadAllText(x.FullName))).ToArray(); Assert.AreEqual(0, invalidFiles.Length, - "Invalid sln files: " + string.Join(", ", invalidFiles.Select(x => x.FullName))); + errorText + string.Join(", ", invalidFiles.Select(x => x.FullName))); } ///