VIP 👤
🏠 ホーム
ベンチマーク
📊 すべてのベンチマーク 🦖 恐竜 v1 🦖 恐竜 v2 ✅ To-Doリストアプリ 🎨 クリエイティブフリーページ 🎯 FSACB - アルティメットショーケース 🌍 翻訳ベンチマーク
モデル
🏆 トップ10モデル 🆓 無料モデル 📋 すべてのモデル ⚙️ 🛠️ Kilo Code モード
リソース
💬 💬 プロンプトライブラリ 📖 📖 AI用語集 🔗 🔗 有用なリンク 🔌 AI API とルーター
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)); }