mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-25 02:58:02 +02:00
Fixed varargs and tuple building
This commit is contained in:
parent
7741344fd2
commit
8171c842f0
5 changed files with 42 additions and 25 deletions
24
IDEHelper/Tests/src/VarArgs.bf
Normal file
24
IDEHelper/Tests/src/VarArgs.bf
Normal file
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
|
||||
namespace Tests
|
||||
{
|
||||
class VarArgs
|
||||
{
|
||||
#if BF_PLATFORM_WINDOWS
|
||||
[CLink, Import("msvcrt.dll")]
|
||||
#else
|
||||
[CLink]
|
||||
#endif
|
||||
public static extern int32 sprintf(char8* dest, char8* fmt, ...);
|
||||
|
||||
[Test]
|
||||
public static void TestBasics()
|
||||
{
|
||||
char8[256] cStr;
|
||||
sprintf(&cStr, "Test %d %0.1f %0.1f", 123, 1.2f, 2.3f);
|
||||
|
||||
String str = scope .(&cStr);
|
||||
Test.Assert(str == "Test 123 1.2 2.3");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue