From c96df58a88b60c7501b3c8a758c0277c17088371 Mon Sep 17 00:00:00 2001 From: Corentin Le Gall Date: Thu, 19 Jul 2018 15:57:30 +0200 Subject: Changed doc to GitBook format + added doc -Changed README.md to a complet GitBook doc. -Added explanations about EvtGrpReceived functions. -Corrected mistakes + reduced lines length. Change-Id: I1a077ddf6acb520a9158de658d3c09b12a2029d4 Signed-off-by: Corentin Le Gall --- .../LuaUnitAssertionFunctions/6_TableAssertions.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 docs/WriteYourTests/Reference/LuaUnitAssertionFunctions/6_TableAssertions.md (limited to 'docs/WriteYourTests/Reference/LuaUnitAssertionFunctions/6_TableAssertions.md') diff --git a/docs/WriteYourTests/Reference/LuaUnitAssertionFunctions/6_TableAssertions.md b/docs/WriteYourTests/Reference/LuaUnitAssertionFunctions/6_TableAssertions.md new file mode 100644 index 0000000..8d29988 --- /dev/null +++ b/docs/WriteYourTests/Reference/LuaUnitAssertionFunctions/6_TableAssertions.md @@ -0,0 +1,19 @@ +# Table assertions + +* **_AFT.assertItemsEquals(actual, expected)** + + Assert that two tables contain the same items, irrespective of their keys. + + This function is practical for example if you want to compare two lists but + where items are not in the same order: + + ```lua + luaunit.assertItemsEquals( {1,2,3}, {3,2,1} ) -- assertion succeeds + ``` + The comparison is not recursive on the items: if any of the items are tables, + they are compared using table equality (like as in assertEquals() ), where the + key matters. + + ```lua + luaunit.assertItemsEquals( {1,{2,3},4}, {4,{3,2,},1} ) -- assertion fails because {2,3} ~= {3,2} + ``` \ No newline at end of file -- cgit 1.2.3-korg