feat(ascii): add remaining distros and default tux logo

Swadhin Biswas committed 7 months ago
5ea50d8
1 parent 46eef69
commit 5ea50d8
1 file changed
+109 -0
Showing 1 changed file+109-0
▼src/ascii/mod.rs
+109-0
1508
1508
],
1509
1509
"ubuntu" => vec![
1510
1510
" \u{1F7E0}\u{1F7E0}\u{1F7E0}\u{1F7E0}\u{1F7E0}",
1511
+ " \u{1F7E0} \u{1F7E0}",
1512
+ " \u{1F7E0} \u{1F7E0}",
1513
+ "\u{1F7E0} \u{1F7E0}\u{1F7E0}\u{1F7E0} \u{1F7E0}",
1514
+ "\u{1F7E0} \u{1F7E0} \u{1F7E0} \u{1F7E0}",
1515
+ "\u{1F7E0} \u{1F7E0}\u{1F7E0}\u{1F7E0} \u{1F7E0}",
1516
+ " \u{1F7E0} \u{1F7E0}",
1517
+ " \u{1F7E0} \u{1F7E0}",
1518
+ " \u{1F7E0}\u{1F7E0}\u{1F7E0}\u{1F7E0}\u{1F7E0}",
1519
+ ],
1520
+ "debian" => vec![
1521
+ " \u{1F534}\u{1F534}\u{1F534}",
1522
+ " \u{1F534} \u{1F534}",
1523
+ " \u{1F534} \u{1F534}",
1524
+ " \u{1F534} \u{1F534}",
1525
+ " \u{1F534} \u{1F534}",
1526
+ " \u{1F534} \u{1F534}",
1527
+ " \u{1F534}\u{1F534}",
1528
+ " \u{1F534}",
1529
+ ],
1530
+ "fedora" => vec![
1531
+ " \u{1F535}\u{1F535}\u{1F535}\u{1F535}\u{1F535}",
1532
+ " \u{1F535} \u{1F535} \u{1F535}",
1533
+ " \u{1F535} \u{1F535}\u{1F535} \u{1F535}",
1534
+ "\u{1F535} \u{1F535} \u{1F535}",
1535
+ "\u{1F535} \u{1F535}\u{1F535}\u{1F535}\u{1F535}\u{1F535}",
1536
+ "\u{1F535} \u{1F535}",
1537
+ " \u{1F535} \u{1F535}",
1538
+ " \u{1F535}\u{1F535}\u{1F535}",
1539
+ ],
1540
+ _ => vec![
1541
+ " \u{1F427}",
1542
+ " \u{1F427}\u{1F427}\u{1F427}",
1543
+ " \u{1F427}\u{1F427}\u{1F427}\u{1F427}\u{1F427}",
1544
+ " \u{1F427}\u{1F427}\u{1F427}\u{1F427}\u{1F427}\u{1F427}\u{1F427}",
1545
+ " \u{1F427}\u{1F427}\u{1F427}\u{1F427}\u{1F427}",
1546
+ " \u{1F427}\u{1F427}\u{1F427}",
1547
+ " \u{1F427}",
1548
+ ],
1549
+ }
1550
+}
1551
+
1552
+#[cfg(test)]
1553
+mod tests {
1554
+ use super::*;
1555
+
1556
+ #[test]
1557
+ fn test_get_ascii_arch() {
1558
+ let art = get_ascii("arch");
1559
+ assert!(!art.lines.is_empty());
1560
+ assert!(!art.colors.is_empty());
1561
+ }
1562
+
1563
+ #[test]
1564
+ fn test_get_ascii_ubuntu() {
1565
+ let art = get_ascii("ubuntu");
1566
+ assert!(!art.lines.is_empty());
1567
+ }
1568
+
1569
+ #[test]
1570
+ fn test_get_ascii_unknown_fallback() {
1571
+ let art = get_ascii("nonexistent_distro_xyz");
1572
+ assert!(!art.lines.is_empty()); // Should return linux_generic
1573
+ }
1574
+
1575
+ #[test]
1576
+ fn test_all_distros_have_art() {
1577
+ let distros = [
1578
+ "arch", "ubuntu", "debian", "fedora", "gentoo", "opensuse",
1579
+ "manjaro", "void", "nixos", "pop", "linuxmint", "alpine",
1580
+ "cachyos", "endeavouros", "artix", "garuda", "kali", "centos",
1581
+ "rocky", "alma", "slackware", "zorin", "elementary", "mx",
1582
+ "solus", "deepin", "raspbian", "freebsd", "openbsd", "macos",
1583
+ "windows", "android", "rhel", "amazon", "chromeos", "bedrock",
1584
+ "clearlinux", "crux", "devuan", "dragonfly", "endless",
1585
+ "exherbo", "guix", "haiku", "hyperbola", "instantos", "mageia",
1586
+ "netbsd", "parabola", "parrot", "peppermint", "porteus",
1587
+ "postmarketos", "puppy", "pureos", "sabayon", "slitaz",
1588
+ "tails", "trisquel",
1589
+ ];
1590
+ for distro in &distros {
1591
+ let art = get_ascii(distro);
1592
+ assert!(
1593
+ !art.lines.is_empty(),
1594
+ "Distro '{}' has no ASCII art lines",
1595
+ distro
1596
+ );
1597
+ assert!(
1598
+ !art.colors.is_empty(),
1599
+ "Distro '{}' has no colors defined",
1600
+ distro
1601
+ );
1602
+ }
1603
+ }
1604
+
1605
+ #[test]
1606
+ fn test_art_has_placeholders() {
1607
+ let art = get_ascii("arch");
1608
+ let has_c1 = art.lines.iter().any(|l| l.contains("{c1}"));
1609
+ assert!(has_c1, "Arch art should have {{c1}} placeholders");
1610
+ }
1611
+
1612
+ #[test]
1613
+ fn test_emoji_art() {
1614
+ let art = get_emoji_art("arch");
1615
+ assert!(!art.is_empty());
1616
+ let generic = get_emoji_art("unknown");
1617
+ assert!(!generic.is_empty());
1618
+ }
1619
+}
1511
1620