Skip to content

Commit

Permalink
Inc a space between flag emojis.
Browse files Browse the repository at this point in the history
Fix binary test comments stating the wrong units.
  • Loading branch information
bengarrett committed Sep 17, 2021
1 parent 3e27f26 commit 39905a9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
13 changes: 7 additions & 6 deletions post_5289/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ func main() {
en := language.English
de := language.German
fr := language.French
fmt.Println("🇬🇧", Decimal(n).String(en))
fmt.Println("🇬🇧", Binary(n).String(en))
fmt.Println("🇩🇪", Decimal(n).String(de))
fmt.Println("🇩🇪", Binary(n).String(de))
fmt.Println("🇫🇷", Decimal(n).String(fr))
fmt.Println("🇫🇷", Binary(n).String(fr))
fmt.Printf("%d bytes is equivalent to\n", n)
fmt.Println("🇬🇧 ", Decimal(n).String(en))
fmt.Println("🇬🇧 ", Binary(n).String(en))
fmt.Println("🇩🇪 ", Decimal(n).String(de))
fmt.Println("🇩🇪 ", Binary(n).String(de))
fmt.Println("🇫🇷 ", Decimal(n).String(fr))
fmt.Println("🇫🇷 ", Binary(n).String(fr))
}

func (n Decimal) String(t language.Tag) string {
Expand Down
12 changes: 6 additions & 6 deletions post_5289/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,24 @@ func TestBinary_String(t *testing.T) {
{"-0 en", -0, en, "0"},
{"1 en", 1, en, "1"},
{"-1 en", -1, en, "-1"},
// Kilobytes
// Kibibytes
{"1k en", 1_024, en, "1.0\u00A0KiB"},
{"1k de", 1_024, de, "1,0\u00A0KiB"},
{"-1k en", -1_024, en, "-1.0\u00A0KiB"},
{"-1k de", -1_024, de, "-1,0\u00A0KiB"},
// Megabytes
// Mebibytes
{"1M en", 1_234_567, en, "1.18\u00A0MiB"},
{"1M de", 1_234_567, de, "1,18\u00A0MiB"},
// Gigabytes
// Gibibytes
{"1G en", 1_234_567_890, en, "1.15\u00A0GiB"},
{"1G de", 1_234_567_890, de, "1,15\u00A0GiB"},
// Terabytes
// Tebibytes
{"10T en", 9_843_234_567_890, en, "8.95\u00A0TiB"},
{"10T de", 9_843_234_567_890, de, "8,95\u00A0TiB"},
// Petabytes
// Pebibytes
{"1P en", 1_200_234_567_890_000, en, "1.07\u00A0PiB"},
{"1P de", 1_200_234_567_890_000, de, "1,07\u00A0PiB"},
// Exabytes
// Exbibytes
{"4E en", 5_000_000_234_567_890_000, en, "4.34\u00A0EiB"},
{"4E de", 5_000_000_234_567_890_000, de, "4,34\u00A0EiB"},
{"max int en", 9_223_372_036_854_775_807, en, "8.00\u00A0EiB"},
Expand Down

0 comments on commit 39905a9

Please sign in to comment.