mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
Support for sized array 'params' parameters
This commit is contained in:
parent
c1a1baea5f
commit
939d05e401
4 changed files with 59 additions and 6 deletions
|
@ -96,6 +96,14 @@ namespace Tests
|
|||
return val3;
|
||||
}
|
||||
|
||||
public static float AddFloats<C>(params float[C] vals) where C : const int
|
||||
{
|
||||
float total = 0;
|
||||
for (var val in vals)
|
||||
total += val;
|
||||
return total;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public static void TestBasics()
|
||||
{
|
||||
|
@ -117,6 +125,8 @@ namespace Tests
|
|||
Test.Assert(self.Method3b(sa) == sa);
|
||||
Test.Assert(self.Method4b(sa, sa2) == sa2);
|
||||
Test.Assert(self.Method5b(sa, sa2, sa3) == sa3);
|
||||
|
||||
Test.Assert(AddFloats(1.0f, 2, 3) == 6.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue