Skip to content

Commit

Permalink
開発版のバージョン表記を変更
Browse files Browse the repository at this point in the history
  • Loading branch information
upsilon committed Jun 10, 2018
1 parent 4d32053 commit f3427d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
6 changes: 3 additions & 3 deletions OpenTween.Tests/MyCommonTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ public void ReplaceAppNameTest(string str, string excepted)
[Theory]
[InlineData("1.0.0.0", "1.0.0")]
[InlineData("1.0.0.1", "1.0.1-dev")]
[InlineData("1.0.0.12", "1.0.1-dev (Build 12)")]
[InlineData("1.0.0.12", "1.0.1-dev+build.12")]
[InlineData("1.0.1.0", "1.0.1")]
[InlineData("1.0.9.1", "1.1.0-dev")]
[InlineData("1.0.9.1", "1.0.10-dev")]
[InlineData("1.1.0.0", "1.1.0")]
[InlineData("1.9.9.1", "2.0.0-dev")]
[InlineData("1.9.9.1", "1.9.10-dev")]
public void GetReadableVersionTest(string fileVersion, string expected)
{
Assert.Equal(expected, MyCommon.GetReadableVersion(fileVersion));
Expand Down
15 changes: 1 addition & 14 deletions OpenTween/MyCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -942,23 +942,10 @@ public static string GetReadableVersion(Version version)
{
versionNum[2] = versionNum[2] + 1;

// 10を越えたら桁上げ
if (versionNum[2] >= 10)
{
versionNum[1] += versionNum[2] / 10;
versionNum[2] %= 10;

if (versionNum[1] >= 10)
{
versionNum[0] += versionNum[1] / 10;
versionNum[1] %= 10;
}
}

if (versionNum[3] == 1)
return string.Format("{0}.{1}.{2}-dev", versionNum[0], versionNum[1], versionNum[2]);
else
return string.Format("{0}.{1}.{2}-dev (Build {3})", versionNum[0], versionNum[1], versionNum[2], versionNum[3]);
return string.Format("{0}.{1}.{2}-dev+build.{3}", versionNum[0], versionNum[1], versionNum[2], versionNum[3]);
}
}

Expand Down

0 comments on commit f3427d4

Please sign in to comment.