func TestConsolidate(t *testing.T) {

	// mock cheatsheets available on multiple cheatpaths
	cheatpaths := []map[string]sheet.Sheet{

		// mock community cheatsheets
		map[string]sheet.Sheet{
			"foo": sheet.Sheet{Title: "foo", Path: "community/foo"},
			"bar": sheet.Sheet{Title: "bar", Path: "community/bar"},
		},

		// mock local cheatsheets
		map[string]sheet.Sheet{
			"bar": sheet.Sheet{Title: "bar", Path: "local/bar"},
			"baz": sheet.Sheet{Title: "baz", Path: "local/baz"},
		},
	}

	// consolidate the cheatsheets
	consolidated := Consolidate(cheatpaths)

	// specify the expected output
	want := map[string]sheet.Sheet{
		"foo": sheet.Sheet{Title: "foo", Path: "community/foo"},
		"bar": sheet.Sheet{Title: "bar", Path: "local/bar"},
		"baz": sheet.Sheet{Title: "baz", Path: "local/baz"},
	}

	// assert that the cheatsheets properly consolidated
	if !reflect.DeepEqual(consolidated, want) {
		t.Errorf(
			"failed to consolidate cheatpaths: want:\n%s, got:\n%s",
			spew.Sdump(want),
			spew.Sdump(consolidated),
		)
	}

}
// TestConsolidate asserts that cheatsheets are properly consolidated
TestConsolidate asserts that cheatsheets are properly consolidated
// TestConsolidate asserts that cheatsheets are properly consolidated
func TestConsolidate(t *testing.T) {
	cheatpaths := []map[string]sheet.Sheet{
		map[string]sheet.Sheet{
			"foo": sheet.Sheet{Title: "foo", Path: "community/foo"},
			"bar": sheet.Sheet{Title: "bar", Path: "community/bar"},
		},
		map[string]sheet.Sheet{
			"bar": sheet.Sheet{Title: "bar", Path: "local/bar"},
			"baz": sheet.Sheet{Title: "baz", Path: "local/baz"},
		},
	}
	consolidated := Consolidate(cheatpaths)
	want := map[string]sheet.Sheet{
		"foo": sheet.Sheet{Title: "foo", Path: "community/foo"},
		"bar": sheet.Sheet{Title: "bar", Path: "local/bar"},
		"baz": sheet.Sheet{Title: "baz", Path: "local/baz"},
	}
	if !reflect.DeepEqual(consolidated, want) {
		t.Errorf(
			"failed to consolidate cheatpaths: want:\n%s, got:\n%s",
			spew.Sdump(want),
			spew.Sdump(consolidated),
		)
	}
}
func TestConsolidate ( t * testing . T ) { cheatpaths := [ ] map [ string ] sheet . Sheet { map [ string ] sheet . Sheet { " " : sheet . Sheet { Title : " " , Path : " " } , " " : sheet . Sheet { Title : " " , Path : " " } , } , map [ string ] sheet . Sheet { " " : sheet . Sheet { Title : " " , Path : " " } , " " : sheet . Sheet { Title : " " , Path : " " } , } , } consolidated := Consolidate ( cheatpaths ) want := map [ string ] sheet . Sheet { " " : sheet . Sheet { Title : " " , Path : " " } , " " : sheet . Sheet { Title : " " , Path : " " } , " " : sheet . Sheet { Title : " " , Path : " " } , } if ! reflect . DeepEqual ( consolidated , want ) { t . Errorf ( " \n \n " , spew . Sdump ( want ) , spew . Sdump ( consolidated ) , ) } }
TestConsolidate asserts that cheatsheets are properly consolidated
TestConsolidate asserts that cheatsheets are properly consolidated
// mock cheatsheets available on multiple cheatpaths // mock community cheatsheets // mock local cheatsheets // consolidate the cheatsheets // specify the expected output // assert that the cheatsheets properly consolidated