Download this file
| 1 | package slides |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "amadan.net/oficina/slides/internal/slides/deck" |
| 7 | ) |
| 8 | |
| 9 | // The library's CSS names are aliases the document takes and layout |
| 10 | // draws (final review, I5): one pattern, deck.FontCSSName. "_Brand" |
| 11 | // was a library name layout would not draw. |
| 12 | func TestTheLibraryNamesFamiliesAsTheDocumentTakesThem(t *testing.T) { |
| 13 | for family, want := range map[string]string{ |
| 14 | "_Brand": "Brand", |
| 15 | "--Brand--": "Brand--", |
| 16 | "...": "Uploaded font 3", |
| 17 | "Café Noir": "Caf Noir", |
| 18 | " Fira X ": "Fira X", |
| 19 | } { |
| 20 | got := cssFamilyName(family, 3) |
| 21 | if got != want || !deck.FontCSSName(got) { |
| 22 | t.Errorf("cssFamilyName(%q) = %q (document takes it: %v), want %q", family, got, deck.FontCSSName(got), want) |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 | |