Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
L
LIGO
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 154
    • Issues 154
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Jira
    • Jira
  • Merge Requests 44
    • Merge Requests 44
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ligolang
  • LIGO
  • Issues
  • #1075

Closed
Open
Opened Dec 18, 2020 by Suzanne Soy@ligo.suzanne.soyMaintainer

fix the repr mock in db_indexer tests

In tests for db indexes, when a test does op1; (merge2 x y); op3, the "repr" function used by op3 must be based on the repr given to op1 but with additionally redirecting x → y (as per the "merge") on the result of that repr. This applies to all db_index_… tests, including the "Invariant" test in db_index_tests.ml

let repr1 = function
  x when Var.equal x a -> a
  x when Var.equal x b -> a
  x when Var.equal x c -> d
  x when Var.equal x d -> d
  x -> x

let compose_repr f g x = f (g x)

repr_after_merge = compose @@ function
  x when Var.equal x a -> e
  x when Var.equal x e -> e
  x -> x

(* the result is the repr a->e b->e c->d d->d e->e anything_else->unchanged *)
Assignee
Assign to
Typer: Prototype MVP
Milestone
Typer: Prototype MVP
Assign milestone
Time tracking
None
Due date
None
Reference: ligolang/ligo#1075