Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoletta committed Sep 27, 2023
1 parent 8e2597a commit 4538465
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkg/runners/cairo_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,3 +710,19 @@ func TestCheckUsedCellsDilutedCheckUsageError(t *testing.T) {
t.Errorf("Check Used Cells Should Have failed With Insufficient Allocated Cells Error")
}
}

func TestRunFibonacciGetExecutionResources(t *testing.T) {
cairoRunConfig := cairo_run.CairoRunConfig{Layout: "all_cairo", ProofMode: false}
runner, err := cairo_run.CairoRun("../../cairo_programs/fibonacci.json", cairoRunConfig)
if err != nil {
t.Errorf("Program execution failed with error: %s", err)
}
expectedExecutionResources := runners.ExecutionResources{
NSteps: 80,
BuiltinsInstanceCounter: make(map[string]uint),
}
executionResources, _ := runner.GetExecutionResources()
if !reflect.DeepEqual(executionResources, expectedExecutionResources) {
t.Errorf("Wong ExecutionResources.\n Expected : %+v, got: %+v", expectedExecutionResources, executionResources)
}
}

0 comments on commit 4538465

Please sign in to comment.