<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          bustedLua單元測試框架

          聯(lián)合創(chuàng)作 · 2023-10-01 15:30

          busted 是 Lua 的單元測試框架,示例代碼:

          require("busted")
          
          describe("Busted unit testing framework", function()
            describe("should be awesome", function()
              it("should be easy to use", function()
                assert.truthy("Yup.")
              end)
          
              it("should have lots of features", function()
                -- deep check comparisons!
                assert.are.same({ table = "great"}, { table = "great" })
          
                -- or check by reference!
                assert.are_not.equal({ table = "great"}, { table = "great"})
          
                assert.true(1 == 1)
                assert.falsy(nil)
                assert.has.error(function() error("Wat") end, "Wat")
              end)
          
              it("should provide some shortcuts to common functions", function()
                assert.are.unique({{ thing = 1 }, { thing = 2 }, { thing = 3 }})
              end)
          
              it("should have mocks and spies for functional tests", function()
                local thing = require("thing_module")
                spy.spy_on(thing, "greet")
                thing.greet("Hi!")
          
                assert.spy(thing.greet).was.called()
                assert.spy(thing.greet).was.called_with("Hi!")
              end)
            end)
          end)

          執(zhí)行結(jié)果:

          瀏覽 4
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  天堂网站黄 | 久久精产国99精产国高潮麻豆 | 天天躁日日躁狠狠躁av | 人妻夜夜爽天天爽麻豆三区网站 | 蜜芽人妻在线 |