normalize_test.mx raw

   1  package iskra
   2  
   3  import "testing"
   4  
   5  func TestNormalizeCode(t *testing.T) {
   6  	got := string(NormalizeCode("  FuncName  "))
   7  	if got != "funcname" {
   8  		t.Fatal("expected 'funcname', got '" | got | "'")
   9  	}
  10  }
  11  
  12  func TestNormalizeCodePreservesUnderscores(t *testing.T) {
  13  	got := string(NormalizeCode("my_var_123"))
  14  	if got != "my_var_123" {
  15  		t.Fatal("should preserve underscores and digits: " | got)
  16  	}
  17  }
  18  
  19  func TestNormalizeCodeEmpty(t *testing.T) {
  20  	got := NormalizeCode("   ")
  21  	if len(got) != 0 {
  22  		t.Fatal("whitespace-only should normalize to empty")
  23  	}
  24  }
  25