Skip to content

Commit

Permalink
Added unit tests, updated docs and README
Browse files Browse the repository at this point in the history
  • Loading branch information
timothymtorres committed Jul 7, 2017
1 parent 1eac691 commit ba9676b
Show file tree
Hide file tree
Showing 15 changed files with 3,136 additions and 12 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ The dice module provides the following:
* Dice pluralism - enable bonus or rerolls to individual dice or to all dice
* Dice caching - reuses dice tables for faster performance

Unit Testing
------------

An LuaUnit test is setup in the tests folder. There are 15 different tests that check the metamethods, new instances, dice cache, and notation are all functioning. To run these tests simply navigate to the test folder on your shell, and execute the command `lua dice_test.lua -v` to see the results.
25 changes: 24 additions & 1 deletion docs/classes/dice.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ <h2>Methods</h2>
<li><a href="#dice:new">dice:new (dice_notation[, minimum])</a></li>
<li><a href="#dice:setClassMin">dice:setClassMin ([min])</a></li>
<li><a href="#dice:resetCache">dice:resetCache ()</a></li>
<li><a href="#dice:getNotation">dice:getNotation ()</a></li>
<li><a href="#dice:getNum">dice:getNum ()</a></li>
<li><a href="#dice:getFaces">dice:getFaces ()</a></li>
<li><a href="#dice:getBonus">dice:getBonus ()</a></li>
Expand Down Expand Up @@ -168,6 +169,28 @@ <h3>Parameters:</h3>



</dd>
<dt>
<a name = "dice:getNotation"></a>
<strong>dice:getNotation ()</strong>
</dt>
<dd>
The raw notation including all negatives



<h3>Returns:</h3>
<ol>

<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



</ol>




</dd>
<dt>
<a name = "dice:getNum"></a>
Expand Down Expand Up @@ -667,7 +690,7 @@ <h3>Returns:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2016-12-10 16:28:33 </i>
<i style="float:right;">Last updated 2017-07-06 21:00:14 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/advanced_uses.lua.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ <h2>advanced_uses.lua</h2>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2016-12-10 16:28:33 </i>
<i style="float:right;">Last updated 2017-07-06 21:00:14 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/basic_dice.lua.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ <h2>basic_dice.lua</h2>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2016-12-10 16:28:33 </i>
<i style="float:right;">Last updated 2017-07-06 21:00:14 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
7 changes: 6 additions & 1 deletion docs/examples/boundry_behaviour.lua.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ <h2>boundry_behaviour.lua</h2>
</span>test_dice:getNum() <span class="comment">-- -7
</span>test_dice:getSets() <span class="comment">-- 0
</span>
<span class="comment">-- If you prefer the raw notation use getNotation()
</span>
notation = test_dice:getNotation()
<span class="global">print</span>(notation) <span class="comment">-- (-7d-94)x0
</span>
<span class="comment">-- The variables are still being tracked properly. Good to know!
</span></pre>

Expand All @@ -88,7 +93,7 @@ <h2>boundry_behaviour.lua</h2>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2016-12-10 16:28:33 </i>
<i style="float:right;">Last updated 2017-07-06 21:00:14 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/metamethods.lua.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ <h2>metamethods.lua</h2>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2016-12-10 16:28:33 </i>
<i style="float:right;">Last updated 2017-07-06 21:00:14 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/minimum.lua.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h2>minimum.lua</h2>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2016-12-10 16:28:33 </i>
<i style="float:right;">Last updated 2017-07-06 21:00:14 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/valid_dice_notation.lua.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h2>valid_dice_notation.lua</h2>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2016-12-10 16:28:33 </i>
<i style="float:right;">Last updated 2017-07-06 21:00:14 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/weapon_samples.lua.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ <h2>weapon_samples.lua</h2>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2016-12-10 16:28:33 </i>
<i style="float:right;">Last updated 2017-07-06 21:00:14 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
25 changes: 24 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ <h2>Methods</h2>
<li><a href="#dice:new">dice:new (dice_notation[, minimum])</a></li>
<li><a href="#dice:setClassMin">dice:setClassMin ([min])</a></li>
<li><a href="#dice:resetCache">dice:resetCache ()</a></li>
<li><a href="#dice:getNotation">dice:getNotation ()</a></li>
<li><a href="#dice:getNum">dice:getNum ()</a></li>
<li><a href="#dice:getFaces">dice:getFaces ()</a></li>
<li><a href="#dice:getBonus">dice:getBonus ()</a></li>
Expand Down Expand Up @@ -168,6 +169,28 @@ <h3>Parameters:</h3>



</dd>
<dt>
<a name = "dice:getNotation"></a>
<strong>dice:getNotation ()</strong>
</dt>
<dd>
The raw notation including all negatives



<h3>Returns:</h3>
<ol>

<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>



</ol>




</dd>
<dt>
<a name = "dice:getNum"></a>
Expand Down Expand Up @@ -667,7 +690,7 @@ <h3>Returns:</h3>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2016-12-10 16:28:33 </i>
<i style="float:right;">Last updated 2017-07-06 21:00:14 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/topics/faq.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h1>Common FAQ</h1>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2016-12-10 16:28:33 </i>
<i style="float:right;">Last updated 2017-07-06 21:00:14 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/topics/instance.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ <h1>Dice Instance Table</h1>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2016-12-10 16:28:33 </i>
<i style="float:right;">Last updated 2017-07-06 21:00:14 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/topics/notation.md.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ <h4>Optional</h4>
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2016-12-10 16:28:33 </i>
<i style="float:right;">Last updated 2017-07-06 21:00:14 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
Expand Down
Loading

0 comments on commit ba9676b

Please sign in to comment.