VIP 👤
🏠 Beranda
Benchmark
📊 Semua Benchmark 🦖 Dinosaurus v1 🦖 Dinosaurus v2 ✅ Aplikasi To-Do List 🎨 Halaman Bebas Kreatif 🎯 FSACB - Showcase Utama 🌍 Benchmark Terjemahan
Model
🏆 Top 10 Model 🆓 Model Gratis 📋 Semua Model ⚙️ Kilo Code
Sumber Daya
💬 Perpustakaan Prompt 📖 Glosarium AI 🔗 Tautan Berguna 🔌 API & Router AI
hard

Unit Test Generation

#testing #coding #quality-assurance

Write unit tests to validate edge cases for a specific function.

Write a comprehensive set of unit tests using a standard testing framework for the following function. Ensure to cover edge cases such as empty input, negative numbers, and null values: function calculateDiscount(price, discountPercentage) { if (!price || price < 0) return 0; return price - (price * (discountPercentage / 100)); }