Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
test: add special case mcopy memory expansion too large
Browse files Browse the repository at this point in the history
  • Loading branch information
obatirou committed Sep 4, 2024
1 parent 44662b4 commit a6bc68d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/src/kakarot/instructions/test_memory_operations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from hypothesis import given
from hypothesis import example, given
from hypothesis.strategies import binary, integers
from starkware.cairo.lang.cairo_constants import DEFAULT_PRIME

Expand Down Expand Up @@ -73,11 +73,17 @@ def test_should_copy_a_value_from_memory(

@given(
memory_init_state=binary(min_size=1, max_size=100),
size_mcopy=integers(min_value=2**128 - 31, max_value=DEFAULT_PRIME - 1),
size_mcopy=integers(min_value=2**128, max_value=DEFAULT_PRIME - 1),
src_offset_mcopy=integers(min_value=0, max_value=100),
dst_offset_mcopy=integers(min_value=0, max_value=100),
)
def test_should_fail_if_memory_expansion_to_large(
@example(
memory_init_state=b"a" * 100,
size_mcopy=2**128 - 1,
src_offset_mcopy=2**128 - 1,
dst_offset_mcopy=2**128 - 1,
)
def test_should_fail_if_memory_expansion_too_large(
self,
cairo_run,
memory_init_state,
Expand Down

0 comments on commit a6bc68d

Please sign in to comment.