Skip to content

Commit

Permalink
- WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
tgiphil committed May 11, 2024
1 parent 228c337 commit c5de894
Show file tree
Hide file tree
Showing 11 changed files with 99 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Source/Mosa.Utility.UnitTests/Numbers/C.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static IEnumerable<char> Series
{
get
{
if (series == null) series = GetSeries();
series ??= GetSeries();

foreach (var value in series)
yield return value;
Expand Down
13 changes: 12 additions & 1 deletion Source/Mosa.Utility.UnitTests/Numbers/I1.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using Mosa.Compiler.Common;

namespace Mosa.Utility.UnitTests.Numbers;

public static class I1
Expand All @@ -10,7 +12,7 @@ public static IEnumerable<sbyte> Series
{
get
{
if (series == null) series = GetSeries();
series ??= GetSeries();

foreach (var value in series)
yield return value;
Expand All @@ -33,6 +35,15 @@ public static IList<sbyte> GetSeries()
AddNegatives(list);

list = list.Distinct().ToList();

//for (var i = 0; i < 7; i++)
//{
// var v = 1 << i;
// list.AddIfNew((sbyte)v);
// list.AddIfNew((sbyte)(v + 1));
// list.AddIfNew((sbyte)(v - 2));
//}

list.Sort();

return list;
Expand Down
13 changes: 12 additions & 1 deletion Source/Mosa.Utility.UnitTests/Numbers/I2.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using Mosa.Compiler.Common;

namespace Mosa.Utility.UnitTests.Numbers;

public static class I2
Expand All @@ -10,7 +12,7 @@ public static IEnumerable<short> Series
{
get
{
if (series == null) series = GetSeries();
series ??= GetSeries();

foreach (var value in series)
yield return value;
Expand Down Expand Up @@ -38,6 +40,15 @@ public static IList<short> GetSeries()

AddNegatives(list);
list = list.Distinct().ToList();

//for (var i = 0; i < 15; i++)
//{
// var v = 1 << i;
// list.AddIfNew((short)v);
// list.AddIfNew((short)(v + 1));
// list.AddIfNew((short)(v - 2));
//}

list.Sort();

return list;
Expand Down
13 changes: 12 additions & 1 deletion Source/Mosa.Utility.UnitTests/Numbers/I4.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using Mosa.Compiler.Common;

namespace Mosa.Utility.UnitTests.Numbers;

public static class I4
Expand All @@ -10,7 +12,7 @@ public static IEnumerable<int> Series
{
get
{
if (series == null) series = GetSeries();
series ??= GetSeries();

foreach (var value in series)
yield return value;
Expand Down Expand Up @@ -44,6 +46,15 @@ public static IList<int> GetSeries()
AddNegatives(list);

list = list.Distinct().ToList();

//for (var i = 0; i < 31; i++)
//{
// var v = 1 << i;
// list.AddIfNew(v);
// list.AddIfNew(v + 1);
// list.AddIfNew(v - 2);
//}

list.Sort();

return list;
Expand Down
13 changes: 12 additions & 1 deletion Source/Mosa.Utility.UnitTests/Numbers/I8.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using Mosa.Compiler.Common;

namespace Mosa.Utility.UnitTests.Numbers;

public static class I8
Expand All @@ -10,7 +12,7 @@ public static IEnumerable<long> Series
{
get
{
if (series == null) series = GetSeries();
series ??= GetSeries();

foreach (var value in series)
yield return value;
Expand Down Expand Up @@ -46,6 +48,15 @@ public static IList<long> GetSeries()

AddNegatives(list);
list = list.Distinct().ToList();

//for (var i = 0; i < 63; i++)
//{
// var v = 1 << i;
// list.AddIfNew(v);
// list.AddIfNew(v + 1);
// list.AddIfNew(v - 2);
//}

list.Sort();

return list;
Expand Down
2 changes: 1 addition & 1 deletion Source/Mosa.Utility.UnitTests/Numbers/R4.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static IEnumerable<float> Series
{
get
{
if (series == null) series = GetSeries();
series ??= GetSeries();

foreach (var value in series)
yield return value;
Expand Down
2 changes: 1 addition & 1 deletion Source/Mosa.Utility.UnitTests/Numbers/R8.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static IEnumerable<double> Series
{
get
{
if (series == null) series = GetSeries();
series ??= GetSeries();

foreach (var value in series)
yield return value;
Expand Down
14 changes: 12 additions & 2 deletions Source/Mosa.Utility.UnitTests/Numbers/U1.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using Mosa.Compiler.Common;

namespace Mosa.Utility.UnitTests.Numbers;

public static class U1
Expand All @@ -10,7 +12,7 @@ public static IEnumerable<byte> Series
{
get
{
if (series == null) series = GetSeries();
series ??= GetSeries();

foreach (var value in series)
yield return value;
Expand All @@ -31,8 +33,16 @@ public static IList<byte> GetSeries()
};

list = list.Distinct().ToList();
list.Sort();

//for (var i = 0; i < 7; i++)
//{
// var v = 1 << i;
// list.AddIfNew((byte)v);
// list.AddIfNew((byte)(v + 1));
// list.AddIfNew((byte)(v - 2));
//}

list.Sort();
return list;
}
}
13 changes: 12 additions & 1 deletion Source/Mosa.Utility.UnitTests/Numbers/U2.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using Mosa.Compiler.Common;

namespace Mosa.Utility.UnitTests.Numbers;

public static class U2
Expand All @@ -10,7 +12,7 @@ public static IEnumerable<ushort> Series
{
get
{
if (series == null) series = GetSeries();
series ??= GetSeries();

foreach (var value in series)
yield return value;
Expand All @@ -35,6 +37,15 @@ public static IList<ushort> GetSeries()
};

list = list.Distinct().ToList();

//for (var i = 0; i < 15; i++)
//{
// var v = 1 << i;
// list.AddIfNew((ushort)v);
// list.AddIfNew((ushort)(v + 1));
// list.AddIfNew((ushort)(v - 2));
//}

list.Sort();

return list;
Expand Down
13 changes: 12 additions & 1 deletion Source/Mosa.Utility.UnitTests/Numbers/U4.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using Mosa.Compiler.Common;

namespace Mosa.Utility.UnitTests.Numbers;

public static class U4
Expand All @@ -10,7 +12,7 @@ public static IEnumerable<uint> Series
{
get
{
if (series == null) series = GetSeries();
series ??= GetSeries();

foreach (var value in series)
yield return value;
Expand Down Expand Up @@ -39,6 +41,15 @@ public static IList<uint> GetSeries()
};

list = list.Distinct().ToList();

//for (var i = 0; i < 31; i++)
//{
// var v = 1u << i;
// list.AddIfNew(v);
// list.AddIfNew(v + 1);
// list.AddIfNew(v - 2);
//}

list.Sort();

return list;
Expand Down
13 changes: 12 additions & 1 deletion Source/Mosa.Utility.UnitTests/Numbers/U8.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) MOSA Project. Licensed under the New BSD License.

using Mosa.Compiler.Common;

namespace Mosa.Utility.UnitTests.Numbers;

public static class U8
Expand All @@ -10,7 +12,7 @@ public static IEnumerable<ulong> Series
{
get
{
if (series == null) series = GetSeries();
series ??= GetSeries();

foreach (var value in series)
yield return value;
Expand Down Expand Up @@ -43,6 +45,15 @@ public static IList<ulong> GetSeries()
};

list = list.Distinct().ToList();

//for (var i = 0; i < 63; i++)
//{
// var v = 1ul << i;
// list.AddIfNew(v);
// list.AddIfNew(v + 1);
// list.AddIfNew(v - 2);
//}

list.Sort();

return list;
Expand Down

0 comments on commit c5de894

Please sign in to comment.