Merge branch 'master' of ssh://gogs.bullercodeworks.com:2200/brian/exercism

This commit is contained in:
2017-08-15 09:57:44 -05:00
92 changed files with 2202 additions and 42 deletions

View File

@@ -1,6 +1,6 @@
# Pov
Reparent a graph on a selected node
Reparent a graph on a selected node.
# Tree Reparenting
@@ -14,7 +14,6 @@ ancestor's perspective:
+-1-+ +-2-+ +-3-+
| | | | | |
4 5 6 7 8 9
```
But the same information can be presented from the perspective of any other node
@@ -40,20 +39,26 @@ a different leaf node) can be seen to follow the path 6-2-0-3-9
This exercise involves taking an input graph and re-orientating it from the point
of view of one of the nodes.
To run the tests simply run the command `go test` in the exercise directory.
## Running the tests
To run the tests run the command `go test` from within the exercise directory.
If the test suite contains benchmarks, you can run these with the `-bench`
flag:
go test -bench .
For more detailed info about the Go track see the [help
page](http://exercism.io/languages/go).
Keep in mind that each reviewer will run benchmarks on a different machine, with
different specs, so the results from these benchmark tests may vary.
## Further information
For more detailed information about the Go track, including how to get help if
you're having trouble, please visit the exercism.io [Go language page](http://exercism.io/languages/go/about).
## Source
Adaptation of exercise from 4clojure [https://www.4clojure.com/](https://www.4clojure.com/)
## Submitting Incomplete Problems
## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.

View File

@@ -259,10 +259,13 @@ func (tc testCase) testResult(got, want []string, msg string, t *testing.T) {
t.FailNow()
}
func TestConstruction(t *testing.T) {
func TestTestVersion(t *testing.T) {
if testVersion != targetTestVersion {
t.Fatalf("Found testVersion = %v, want %v", testVersion, targetTestVersion)
}
}
func TestConstruction(t *testing.T) {
for _, tc := range testCases {
got := tc.graph().ArcList()
want := tc.arcStrings