(t *testing.T)
| 452 | } |
| 453 | |
| 454 | func TestSetOption(t *testing.T) { |
| 455 | eval, err := NewEvaluator() |
| 456 | if err != nil { |
| 457 | t.Fatalf("NewEvaluator() failed with: %v", err) |
| 458 | } |
| 459 | |
| 460 | err = eval.AddSerializableOption(&testContainerOption{container: "google.protobuf"}) |
| 461 | if err != nil { |
| 462 | t.Errorf("eval.AddSerializableOption() got error: %v, wanted nil", err) |
| 463 | } |
| 464 | |
| 465 | val, _, err := eval.Evaluate("Int64Value{value: 42} == 42") |
| 466 | if err != nil { |
| 467 | t.Errorf("eval.Evaluate() got error: %v, expected nil", err) |
| 468 | } |
| 469 | |
| 470 | if !val.Value().(bool) { |
| 471 | t.Error("eval.Evaluate() got false expected true") |
| 472 | } |
| 473 | } |
| 474 | |
| 475 | func TestSetOptionError(t *testing.T) { |
| 476 | eval, err := NewEvaluator() |
nothing calls this directly
no test coverage detected