mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Use "String" consistently for "char[]" (#694)
Use "String" consistently for "char[]". Fix win32 return value.
This commit is contained in:
committed by
GitHub
parent
5b2b4e900f
commit
43dc2d650c
@@ -1,7 +1,7 @@
|
||||
module conv_tests;
|
||||
import std::io;
|
||||
|
||||
fn void! comparison_helper_32_to_8(Char32 c32, char[] expected_output)
|
||||
fn void! comparison_helper_32_to_8(Char32 c32, String expected_output)
|
||||
{
|
||||
char[8] out;
|
||||
usz len = conv::char32_to_utf8(c32, &out, 4)?;
|
||||
@@ -12,7 +12,7 @@ fn void! comparison_helper_32_to_8(Char32 c32, char[] expected_output)
|
||||
}
|
||||
}
|
||||
|
||||
fn void! comparison_helper_8_to_32(char[] in, Char32 c32)
|
||||
fn void! comparison_helper_8_to_32(String in, Char32 c32)
|
||||
{
|
||||
usz len = in.len;
|
||||
Char32 res = conv::utf8_to_char32(in.ptr, &len)?;
|
||||
@@ -20,7 +20,7 @@ fn void! comparison_helper_8_to_32(char[] in, Char32 c32)
|
||||
assert(res == c32, "Expected character match.");
|
||||
}
|
||||
|
||||
fn void assert_utf8_is_error(char[] in)
|
||||
fn void assert_utf8_is_error(String in)
|
||||
{
|
||||
usz len = in.len;
|
||||
assert(catch(conv::utf8_to_char32(in.ptr, &len)), "Expected error");
|
||||
|
||||
@@ -6,7 +6,7 @@ fn void! rc_crypt() @test
|
||||
Rc4 rc;
|
||||
rc.init(&&x"63727970746969");
|
||||
char[200] x;
|
||||
char[] text = "The quick brown fox jumps over the lazy dog.";
|
||||
String text = "The quick brown fox jumps over the lazy dog.";
|
||||
rc.crypt(text, &x);
|
||||
char[*] res = x"2ac2fecdd8fbb84638e3a4
|
||||
820eb205cc8e29c28b9d5d
|
||||
|
||||
Reference in New Issue
Block a user