MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestOracleKeywordListNonNil

Function TestOracleKeywordListNonNil

pkg/sql/parser/dialect_test.go:406–424  ·  view source on GitHub ↗

--------------------------------------------------------------------------- Oracle keywords --------------------------------------------------------------------------- TestOracleKeywordListNonNil checks that Oracle dialect returns a non-empty keyword list (previously returned nil).

(t *testing.T)

Source from the content-addressed store, hash-verified

404// TestOracleKeywordListNonNil checks that Oracle dialect returns a non-empty
405// keyword list (previously returned nil).
406func TestOracleKeywordListNonNil(t *testing.T) {
407 kws := keywords.DialectKeywords(keywords.DialectOracle)
408 if kws == nil {
409 t.Fatal("DialectKeywords(DialectOracle) returned nil; expected non-empty keyword list")
410 }
411 if len(kws) == 0 {
412 t.Fatal("DialectKeywords(DialectOracle) returned empty slice")
413 }
414 // Verify a few known Oracle keywords are present
415 found := make(map[string]bool)
416 for _, kw := range kws {
417 found[kw.Word] = true
418 }
419 for _, expected := range []string{"ROWNUM", "SYSDATE", "DUAL", "NVL", "DECODE"} {
420 if !found[expected] {
421 t.Errorf("expected Oracle keyword %q not found in list", expected)
422 }
423 }
424}
425
426// ---------------------------------------------------------------------------
427// helpers

Callers

nothing calls this directly

Calls 2

DialectKeywordsFunction · 0.92
ErrorfMethod · 0.65

Tested by

no test coverage detected