diff --git a/Makefile b/Makefile index 11b2142..bb59e37 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ endif install: - luarocks make rockspecs/lua-quickcheck-0.2-2.rockspec + luarocks make rockspecs/lua-quickcheck-0.2-4.rockspec fixtures: $(MAKE) -C spec/fixtures build diff --git a/rockspecs/lua-quickcheck-0.2-3.rockspec b/rockspecs/lua-quickcheck-0.2-4.rockspec similarity index 89% rename from rockspecs/lua-quickcheck-0.2-3.rockspec rename to rockspecs/lua-quickcheck-0.2-4.rockspec index 46dedf9..0e5485a 100644 --- a/rockspecs/lua-quickcheck-0.2-3.rockspec +++ b/rockspecs/lua-quickcheck-0.2-4.rockspec @@ -1,18 +1,18 @@ package = 'lua-quickcheck' -version = '0.2-3' +version = '0.2-4' source = { url = 'git://github.com/Primordus/lua-quickcheck', - tag = 'v0.2-3' + tag = 'v0.2-4' } description = { summary = 'Property based testing library for Lua', detailed = [[ - QuickCheck is a way to do property based testing using randomly generated input. - Lua-QuickCheck comes with the ability to randomly generate and shrink integers, - doubles, booleans, strings, tables, custom datatypes, ... - All QuickCheck needs is a property function -- it will then randomly generate - inputs to that function and call the property for each set of inputs. If the - property fails (whether by an error or not satisfying your property), + QuickCheck is a way to do property based testing using randomly generated input. + Lua-QuickCheck comes with the ability to randomly generate and shrink integers, + doubles, booleans, strings, tables, custom datatypes, ... + All QuickCheck needs is a property function -- it will then randomly generate + inputs to that function and call the property for each set of inputs. If the + property fails (whether by an error or not satisfying your property), the inputs are "shrunk" to find a smaller counter-example. ]], homepage = 'https://github.com/Primordus/lua-quickcheck', @@ -34,8 +34,8 @@ build = { ['lqc.generators.float'] = 'lqc/generators/float.lua', ['lqc.generators.any'] = 'lqc/generators/any.lua', ['lqc.generators.int'] = 'lqc/generators/int.lua', - ['lqc.generators.str'] = 'lqc/generators/string.lua', - ['lqc.generators.tbl'] = 'lqc/generators/table.lua', + ['lqc.generators.string'] = 'lqc/generators/string.lua', + ['lqc.generators.table'] = 'lqc/generators/table.lua', ['lqc.generator'] = 'lqc/generator.lua', ['lqc.random'] = 'lqc/random.lua', ['lqc.helpers.deep_equals'] = 'lqc/helpers/deep_equals.lua', diff --git a/spec/fixtures/fixtures.c b/spec/fixtures/fixtures.c index 5486269..c5c5c87 100644 --- a/spec/fixtures/fixtures.c +++ b/spec/fixtures/fixtures.c @@ -1,4 +1,5 @@ +#include #include #include #include @@ -71,7 +72,7 @@ struct point bool point_add(struct point* a, struct point* b, struct point* c_out) { if (!a || !b || !c_out) { return false; } - c_out->x = a->x + b->x; + c_out->x = a->x + b->x; c_out->y = a->y + b->y; return true; } @@ -84,11 +85,11 @@ bool point_add(struct point* a, struct point* b, struct point* c_out) const char* str_add(const char* const a, const char* const b) { if (!a || !b) { return NULL; } - + size_t len_a = strlen(a); size_t len_b = strlen(b); char* result = (char*) malloc(sizeof(char) * (len_a + len_b + 1)); - + if (!result) { return NULL; } memcpy(result, a, len_a);