summary refs log blame commit diff stats
path: root/go/space-age/cases_test.go
blob: 5280b07a30dd29eac55f0658e90404c77e9055c9 (plain) (tree)




























































                                                                              
package space

// Source: exercism/problem-specifications
// Commit: 28b3dac0 space-age: restrict seconds to fit within 32-bit int range
// Problem Specifications Version: 1.2.0

var testCases = []struct {
	description string
	planet      Planet
	seconds     float64
	expected    float64
}{
	{
		description: "age on Earth",
		planet:      "Earth",
		seconds:     1000000000,
		expected:    31.69,
	},
	{
		description: "age on Mercury",
		planet:      "Mercury",
		seconds:     2134835688,
		expected:    280.88,
	},
	{
		description: "age on Venus",
		planet:      "Venus",
		seconds:     189839836,
		expected:    9.78,
	},
	{
		description: "age on Mars",
		planet:      "Mars",
		seconds:     2129871239,
		expected:    35.88,
	},
	{
		description: "age on Jupiter",
		planet:      "Jupiter",
		seconds:     901876382,
		expected:    2.41,
	},
	{
		description: "age on Saturn",
		planet:      "Saturn",
		seconds:     2000000000,
		expected:    2.15,
	},
	{
		description: "age on Uranus",
		planet:      "Uranus",
		seconds:     1210123456,
		expected:    0.46,
	},
	{
		description: "age on Neptune",
		planet:      "Neptune",
		seconds:     1821023456,
		expected:    0.35,
	},
}
gt;,gc %s,<.*f1.*,<span class="Mu">&</span>,gc %s,<.*f2.*,<span class="Mu">&</span>,gc pre { white-space: pre-wrap; font-family: monospace; color: #aaaaaa; background-color: #000000; } body { font-family: monospace; color: #aaaaaa; background-color: #000000; } a { color:#4444ff; } * { font-size: 1em; } .Constant, .MuConstant { color: #008080; } .Comment { color: #8080ff; } .Delimiter { color: #600060; } .Normal { color: #aaaaaa; } .Mu, .Mu .Normal, .Mu .Constant { color: #ffffff; } .Op { color: #ff8888; } .CommentedCode { color: #666666; }