Test internal/datafiles, internal/datatype, internal/proven and internal/builtinfunc, and allow the root to import them

This commit is contained in:
2026-10-05 15:26:52 +02:00
committed by Lillem4n
parent e4d14944a2
commit 83e4daefdb
7 changed files with 344 additions and 48 deletions
+25
View File
@@ -0,0 +1,25 @@
package datatype
import "testing"
func TestEachDatatypeIsSpelledAsDataWritesIt(t *testing.T) {
for d, want := range map[DataType][2]string{
String: {"string", "text"},
Integer: {"integer", "an integer"},
Number: {"number", "a number"},
Boolean: {"boolean", "a boolean"},
} {
if d.String() != want[0] || Noun(d) != want[1] {
t.Errorf("%d: String = %q, Noun = %q, want %q", int(d), d.String(), Noun(d), want)
}
}
if Count != 4 {
t.Errorf("Count = %d, want the four datatypes", Count)
}
}
func TestStringNamesADatatypeNoDataWrites(t *testing.T) {
if got := DataType(9).String(); got != "DataType(9)" {
t.Errorf("String = %q, want DataType(9)", got)
}
}