MCPcopy Create free account
hub / github.com/cel-expr/cel-go / TestProcess

Function TestProcess

repl/evaluator_test.go:497–1336  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

495}
496
497func TestProcess(t *testing.T) {
498 var testCases = []struct {
499 name string
500 commands []Cmder
501 wantText string
502 wantExit bool
503 wantError bool
504 ignoreWhitespace bool
505 }{
506 {
507 name: "CompileResult",
508 commands: []Cmder{
509 &compileCmd{
510 expr: "3u",
511 },
512 },
513 wantText: `type_map: {
514 key: 1
515 value: {
516 primitive: UINT64
517 }
518 }
519 source_info: {
520 location: "<input>"
521 line_offsets: 3
522 positions: {
523 key: 1
524 value: 0
525 }
526 }
527 expr: {
528 id: 1
529 const_expr: {
530 uint64_value: 3
531 }
532 }`,
533 wantExit: false,
534 wantError: false,
535 ignoreWhitespace: true,
536 },
537 {
538 name: "FormatNumberResult",
539 commands: []Cmder{
540 &evalCmd{
541 expr: "1u + 2u",
542 },
543 },
544 wantText: "3u : uint",
545 wantExit: false,
546 wantError: false,
547 },
548 {
549 name: "FormatStringResult",
550 commands: []Cmder{
551 &evalCmd{
552 expr: `'a' + r'b\1'`,
553 },
554 },

Callers

nothing calls this directly

Calls 7

ProcessMethod · 0.95
NewTypeParamFunction · 0.92
TypesFunction · 0.92
mustParseTypeFunction · 0.85
NewEvaluatorFunction · 0.85
stripWhitespaceFunction · 0.70
ExtendMethod · 0.45

Tested by

no test coverage detected