exercism / vimscript

Exercism exercises in Vim script.
https://exercism.org/tracks/vimscript
MIT License
20 stars 24 forks source link

Add darts #177

Closed BNAndras closed 10 months ago

BNAndras commented 11 months ago

Related to #172

BNAndras commented 11 months ago

I’ll troubleshoot tomorrow. The darts tests passed locally.

BNAndras commented 11 months ago

Still getting (X) Vim(call):E118: Too many arguments for function: Score. The auto-generated tests pass in two arguments each time. The Score function in example.vim also takes two arguments. Since the CI uses 8.2 and I'm on 9.0, I removed the earlier pow call in case that was the actual culprit, but that wasn't it apparently.

BNAndras commented 11 months ago

All 13 tests pass locally on 8.2 without modification so that's not the problem

BNAndras commented 11 months ago

Reviewed my assumptions and I found the culprit. The CI (below) sources each example.vim before running all the tests.dart's Score takes two arguments but is later overwritten by the single-argument Score from scrabble-score. I need to change Score's name to avoid the problem. I'm thinking ScrabbleScore is a bit verbose but is more meaningful than MyScore.

for file in glob('exercises/practice/*/.meta/example.vim', 0, 1)
  execute 'source' file
endfor
kotp commented 11 months ago

Reviewed my assumptions and I found the culprit. The CI (below) sources each example.vim before running all the tests.dart's Score takes two arguments but is later overwritten by the single-argument Score from scrabble-score. I need to change Score's name to avoid the problem. I'm thinking ScrabbleScore is a bit verbose but is more meaningful than MyScore.

for file in glob('exercises/practice/*/.meta/example.vim', 0, 1)
  execute 'source' file
endfor

We should make that not happen. We should be doing this before running each test, and only for the tested folder, not before running all tests.

It was just a matter of time before we were going to colide.

BNAndras commented 11 months ago

I’ll take a look this weekend.

BNAndras commented 10 months ago

@kotp, I renamed Score to DartScore to avoid the original naming issue. We'll still need to deal with the CI in the other PR so it doesn't come up again.

kotp commented 10 months ago

We could change it to Darts as it describes the game in general.

BNAndras commented 10 months ago

Makes sense. I thought briefly about naming it DartToss so I'll revise.