MCPcopy Create free account
hub / github.com/crossoverJie/gscript / TestStringBuilder

Function TestStringBuilder

byte_test.go:37–53  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35 NewCompiler().Compiler(script)
36}
37func TestStringBuilder(t *testing.T) {
38 script := `
39StringBuilder b = StringBuilder();
40b.writeString("10");
41b.writeString("20");
42int l = b.writeString("30");
43string s = b.String();
44printf("s:%s, len=%d ",s,l);
45assertEqual(s,"102030");
46byte[] b2 = toByteArray("40");
47b.WriteBytes(b2);
48s = b.String();
49assertEqual(s,"10203040");
50println(s);
51`
52 NewCompiler().Compiler(script)
53}
54func TestStringBuilder3(t *testing.T) {
55 script := `
56Strings s = Strings();

Callers

nothing calls this directly

Calls 2

NewCompilerFunction · 0.85
CompilerMethod · 0.80

Tested by

no test coverage detected