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

Rename test generator files #610

Merged
merged 4 commits into from
Apr 7, 2017
Merged

Conversation

robphoenix
Copy link
Contributor

closes #607

README.md Outdated
**example.go** - This is a reference solution for the exercise.

**leap.go** - This is a *stub file*, and will only be present in some exercises.

**leap_test.go** - This is the main test file for the exercise.

**.meta/** - The *.meta* directory can be used to contain files
that are not meant to be included when a user fetches an exercise, for instance
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ironically, now that this file says .meta isn't included, it may imply (solely by omission) that example.go is delivered to the student - I suggest it would be good to make clear that exmaple.go is also not delivered.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a note

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another possibility was including it in example.go's explanation. I'm OK with either, so keep the one you like more.

README.md Outdated
that are not meant to be included when a user fetches an exercise, for instance
test case generators.

**gen.go** - This file generates the *cases_test.go* file, and will only
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is any confusion possible about whether gen.go is in .meta? I suppose the tree makes it clear enough

README.md Outdated
directory and run `go run exercises/<problem>/example_gen.go`. You should see
that the `<problem>/test_cases.go` file has changed. Commit the change.
directory and run `go run exercises/<exercise>/.meta/gen.go`. You should see
that the `<exercise>/test_cases.go` file has changed. Commit the change.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

funnily enough, it's cases_test.go (simply so that it has the _test.go suffix), so while you're changing this line from problem->exercise, probably good to correct this too?

var dirProblem string
// dirExercise is the location that the test cases should be generated to.
// This assumes that the generator script lives in the .meta directory within
// the exercise directory. Falls back to the present working directory.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"to the present working directory" is no longer accurate now that it's "..", right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooh, good catch. Left it as is and changed back line 63 in response to your other comment.

gen/gen.go Outdated
if dirProblem == "" {
dirProblem = "."
if dirExercise == "" {
dirExercise = ".."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsure this really needs to change, but since we never get here for any current generator I can't complain since there is no correct answer nor incorrect answer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel it's probably better to leave as is.

gen/gen.go Outdated
@@ -60,7 +60,7 @@ func init() {
dirExercise = filepath.Join(path, "..", "..")
}
if dirExercise == "" {
dirExercise = ".."
dirExercise = "."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you put this change into the README commit, though it should probably go in the "fix path" commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh fudge.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed ✔️

@robphoenix robphoenix merged commit d20228f into exercism:master Apr 7, 2017
@robphoenix robphoenix deleted the rename-gen-files branch April 7, 2017 21:00
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

Successfully merging this pull request may close these issues.

Is the example_gen.go file appropriately named?
2 participants