(t *testing.T)
| 495 | } |
| 496 | |
| 497 | func 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 | }, |
nothing calls this directly
no test coverage detected