Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Schweber opened this issue Nov 30, 2024 · 0 comments

Comments

@Schweber
Copy link

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?

@Schweber Schweber changed the title valentines_day: local gleam testt results in Pattern match failed but online evaluation on exercism passes valentines_day: local gleam test results in Pattern match failed but online evaluation on exercism passes Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant