Skip to content

valentines_day: local gleam test results in Pattern match failed but online evaluation on exercism passes #81

@Schweber

Description

@Schweber

I'm using gleam 1.6.2 and freshly downloaded the exercise via the exercism CLI. I am experiencing this problem also with other exercises. In valentines_day i use the following valentines_day.gleam:

// TODO: please define the 'Approval' custom type
pub type Approval {
  Yes
  No
  Maybe
}

// TODO: please define the 'Cuisine' custom type
pub type Cuisine {
  Korean
  Turkish
}

// TODO: please define the 'Genre' custom type
pub type Genre {
  Crime
  Horror
  Romance
  Thriller
}

// TODO: please define the 'Activity' custom type
pub type Activity {
  BoardGame
  Chill
  Movie(Genre)
  Restaurant(Cuisine)
  Walk(Int)
}

pub fn rate_activity(activity: Activity) -> Approval {
  case activity {
    Movie(Romance) -> Yes
    Restaurant(Korean) -> Yes
    Restaurant(Turkish) -> Maybe
    Walk(f) if f > 11 -> Yes
    Walk(f) if f > 6 -> Maybe
    _ -> No
  }
}

If i test it locally i get:

$ gleam test                                                               
  Compiling valentines_day
   Compiled in 0.23s
    Running valentines_day_test.main
runtime error: let assert

Pattern match failed, no pattern matched the value.

unmatched value:
  Error(Enoent)

stacktrace:
  exercism/test_runner.main /home/sperber/Programmieren/Exercism/gleam/valentines-day/build/packages/exercism_test_runner/src/exercism/test_runner.gleam:19

but the online evaluation in exercism passes and i think exercism is right.

Was there maybe a change to the way gleam handles tests and this hasn't been updated in the local tests of the exercises?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions