मैं सिर्फ स्काला के साथ शुरू हो रही हूँ, और मैं सोच रहा हूँ जो भाषा सुविधा आपको ऐसा करने के लिए अनुमति देता है:स्कैला के काम के लिए "चश्मा" बीडीडी ढांचा कैसे काम करता है?
"PersistentQueue" should {
"add and remove one item" in {
withTempFolder {
val q = new PersistentQueue(folderName, "work", Config.fromMap(Map.empty))
q.setup
q.length mustEqual 0
q.totalItems mustEqual 0
q.bytes mustEqual 0
q.journalSize mustEqual 0
q.add("hello kitty".getBytes)
q.length mustEqual 1
q.totalItems mustEqual 1
q.bytes mustEqual 11
q.journalSize mustEqual 32
new String(q.remove.get.data) mustEqual "hello kitty"
q.length mustEqual 0
q.totalItems mustEqual 1
q.bytes mustEqual 0
q.journalSize mustEqual 33
q.close
dumpJournal("work") mustEqual "add(11:0:hello kitty), remove"
}
}
}
unit tests for Kestrel से है यही कारण है कि।
यहां क्या हो रहा है? क्या "PersistentQueue" should
का मतलब है कि स्कैला स्ट्रिंग क्लास को "चाहिए" विधि के साथ बढ़ाया गया है, या यहां कुछ और हो रहा है? मैंने स्कैला प्रलेखन के माध्यम से एक त्वरित रूप से देखा था लेकिन यह नहीं देख सका कि इस कोड नमूने के लिए कौन सी भाषा विशेषताओं का उपयोग किया जा रहा है।