<commit_before>// Copyright 2015 tsuru authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package hc

import (
	"errors"
	"testing"

	"launchpad.net/gocheck"
)

func Test(t *testing.T) {
	gocheck.TestingT(t)
}

type HCSuite struct{}

var _ = gocheck.Suite(HCSuite{})

func (HCSuite) TestCheck(c *gocheck.C) {
	AddChecker("success", successChecker)
	AddChecker("failing", failingChecker)
	expected := []Result{
		{Name: "success", Status: HealthCheckOK},
		{Name: "failing", Status: "fail - something went wrong"},
	}
	result := Check()
	c.Assert(result, gocheck.DeepEquals, expected)
}


func successChecker() error {
	return nil
}

func failingChecker() error {
	return errors.New("something went wrong")
}
<commit_msg>hc: format code<commit_after>// Copyright 2015 tsuru authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package hc

import (
	"errors"
	"testing"

	"launchpad.net/gocheck"
)

func Test(t *testing.T) {
	gocheck.TestingT(t)
}

type HCSuite struct{}

var _ = gocheck.Suite(HCSuite{})

func (HCSuite) TestCheck(c *gocheck.C) {
	AddChecker("success", successChecker)
	AddChecker("failing", failingChecker)
	expected := []Result{
		{Name: "success", Status: HealthCheckOK},
		{Name: "failing", Status: "fail - something went wrong"},
	}
	result := Check()
	c.Assert(result, gocheck.DeepEquals, expected)
}

func successChecker() error {
	return nil
}

func failingChecker() error {
	return errors.New("something went wrong")
}

{'fraction_non_alphanumeric': 0.13238036047234308, 'fraction_numerical': 0.004972032318210068, 'mean_word_length': 4.551724137931035, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6056076', 'n_tokens_mistral': 559, 'n_tokens_neox': 561, 'n_words': 162}