Added String.fromByte with docs and unit test

This commit is contained in:
Walter Schell
2019-02-27 08:05:07 -05:00
parent 487f53ace1
commit a437e804ba
9 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,3 @@
System.print(String.fromByte(65)) // expect: A
System.print(String.fromByte(0).bytes[0]) // expect: 0
System.print(String.fromByte(255).bytes[0]) // expect: 255

View File

@ -0,0 +1 @@
System.print(String.fromByte(12.34)) // expect runtime error: Byte must be an integer.

View File

@ -0,0 +1 @@
System.print(String.fromByte("not num")) // expect runtime error: Byte must be a number.

View File

@ -0,0 +1 @@
System.print(String.fromByte(0xff + 1)) // expect runtime error: Byte cannot be greater than 0xff.

View File

@ -0,0 +1 @@
System.print(String.fromByte(-1)) // expect runtime error: Byte cannot be negative.