difects
- Assertion testing library for Ruby
DIFECTS is an assertion testing library for Ruby that emphasizes a simple assertion vocabulary, instant debuggability of failures, and flexibility in composing tests.
Adds only 7 mnemonic method names to your memory:
D
escribe, I
nform, F
alse, E
rror, C
atch, T
rue, and S
hare.
Lets you debug assertion failures interactively.
Lets you nest tests, assertions, and execution hooks.
Maintains a detailed report of assertion failures.
Implemented in 420 lines of pure Ruby.
Prerequisites:
Installing:
gem install difects
Upgrading:
gem update difects
Removing:
gem uninstall difects
difects
[OPTIONS] (FILE|GLOB) ...
Evaluates the given FILEs and also files matching the given GLOB patterns.
The exit status of this command reflects the number of errors and assertion failures up to a maximum of 255 (to avoid 8-bit unsigned integer overflow).
-d
, --debug
Launch interactive debugger upon assertion failures.
-h
, --help
Display this manual and exit.
-v
, --version
Print version number and exit.
The D()
method creates a new test, which is analagous to the describe
keyword in RSpec and the concept of a "test case" in xUnit. A test may
contain nested tests (see Insulation below).
D "outer test" do
# assertions and logic here
D "inner test" do
# more assertions and logic here
end
end
A hook is a scheduled point of entry into the test execution process. The
D()
method provides several of them:
D "outer test" do
D .< { puts "before each nested test" }
D .> { puts "after each nested test" }
D .<< { puts "before all nested tests" }
D .>> { puts "after all nested tests" }
D "inner test" do
# assertions and logic here
end
end
A hook method can be called multiple times. Every call to a hook method schedules additional logic to be executed during the hook:
D .< { puts "do something" }
D .< { puts "do something more!" }
The D!()
method defines a new test that is explicitly insulated from
the tests that contain it and also from the top-level Ruby environment.
Root-level calls to the D()
method are insulated by default.
Inside an insulated test, you are free to mix-in (using the extend
keyword,
not the include
keyword) any modules your test logic needs and also define
your own constants, methods, and classes.
S()
Mechanism for sharing code. When called with a block, it shares the given block (under a given identifier) for injection into other tests. When called without a block, it injects a previously shared block (under a given identifier) into the environment where it is called.
S!()
Combination of the two uses of the S()
method: it lets you simultaneously
share a block of code while injecting it into the environment where that
method is called.
S?()
Checks whether any code has been shared under a given identifier.
I()
Mechanism for inserting arbitrary Ruby objects into the test execution report. You can think of this method as a way to inform yourself.
I!()
Starts the interactive debugger at the location where it is called.
Tests are executed in depth-first search (DFS) order.
You can configure the test execution process using:
DIFECTS.debug = your_choice_here
DIFECTS.quiet = your_choice_here
You can execute all tests defined thus far using:
DIFECTS.start
You can stop the execution at any time using:
DIFECTS.stop
You can view the results of execution using:
puts DIFECTS.trace.to_yaml
puts DIFECTS.stats.to_yaml
You can mix-in the DIFECTS
module into your program and execute all tests
defined by your program before it terminates by simply adding the following
line at the top of your program:
require 'difects/auto'
See the API documentation for more information and examples.
The following methods accept a block parameter and assert something about the result of executing that block. They also accept an optional message, which is shown in failure reports (see Failures below) if they fail.
T()
assert true (not nil
and not false
)
F()
assert not true (nil
or false
)
E()
assert that an execption is raised
C()
assert that a symbol is thrown
For the T()
and F()
methods, you may also pass the condition to be
asserted as the first argument (instead of passing it as a block). This might
result in a less noisy more pleasing syntax, depending on your taste:
D "Lottery" do
winning_ticket = rand()
D "My chances of winning" do
my_ticket = rand()
# passing the condition as a block:
F("I won?! Dream on.") { my_ticket == winning_ticket }
# passing the condition as an argument:
F my_ticket == winning_ticket, "I won?! Dream on."
end
end
The following methods are the opposite of normal assertions.
T!()
same as F()
F!()
same as T()
E!()
assert that an exception is not raised
C!()
assert that a symbol is not thrown
The following methods let you check the outcome of an assertion without recording a success or failure in the test execution report.
T?()
returns true if T()
passes; false otherwise
F?()
returns true if F()
passes; false otherwise
E?()
returns true if E()
passes; false otherwise
C?()
returns true if C()
passes; false otherwise
Assertions failures are reported in the following manner:
- fail: block must yield true (!nil && !false)
call:
- test/simple.rb:17
- test/simple.rb:3
code: |-
[12..22] in test/simple.rb
12
13 D "with more nested tests" do
14 x = 5
15
16 T { x > 2 } # passes
=> 17 F { x > 2 } # fails
18 E { x.hello } # passes
19 end
20 end
21
22 # equivalent of before(:each) or setup()
bind: test/simple.rb:17
vars:
x: (Fixnum) 5
y: (Fixnum) 83
Failure reports are composed of the following sections:
Description of the assertion failure.
Stack trace leading to the point of failure.
Source code surrounding the point of failure.
Location where local variables (in the "vars" section) were extracted.
Local variables visible at the point of failure.
After the failure is reported, you will be placed into a debugger to
investigate the failure if the DIFECTS.debug
option is enabled.
Assertion failure reports can be accessed at any time within the test
execution trace provided by the DIFECTS.trace()
method.
DIFECTS can emulate several popular testing libraries:
RSpec emulation layer
Test::Unit emulation layer
Minitest emulation layer
Readability emulation layer
Simply require one of these emulation layers into your test suite and you can write your tests using the familiar syntax of the testing library it emulates.
This library emulates RSpec by adding the following methods to the
DIFECTS
module.
after
(what, &block)Defined at lib/difects/spec.rb:21
before
(what, &block)Defined at lib/difects/spec.rb:10
context
(*args, &block)Defined at lib/difects.rb:1126
describe
(*args, &block)Defined at lib/difects.rb:1126
it
(*args, &block)Defined at lib/difects.rb:1126
This library emulates Test::Unit by adding the following methods to the
DIFECTS
module.
assert
(*args, &block)Defined at lib/difects.rb:1126
assert_empty
(collection, message=nil)Defined at lib/difects/unit.rb:26
assert_equal
(expected, actual, message=nil)Defined at lib/difects/unit.rb:31
assert_in_delta
(expected, actual, delta=nil, message=nil)Defined at lib/difects/unit.rb:36
assert_in_epsilon
(expected, actual, delta=nil, message=nil)Defined at lib/difects/unit.rb:36
assert_include
(item, collection, message=nil)Defined at lib/difects/unit.rb:47
assert_instance_of
(klass, object, message=nil)Defined at lib/difects/unit.rb:52
assert_kind_of
(klass, object, message=nil)Defined at lib/difects/unit.rb:57
assert_match
(pattern, string, message=nil)Defined at lib/difects/unit.rb:67
assert_nil
(object, message=nil)Defined at lib/difects/unit.rb:62
assert_not
(*args, &block)Defined at lib/difects.rb:1126
assert_not_empty
(collection, message=nil)Defined at lib/difects/unit.rb:26
assert_not_equal
(expected, actual, message=nil)Defined at lib/difects/unit.rb:31
assert_not_in_delta
(expected, actual, delta=nil, message=nil)Defined at lib/difects/unit.rb:36
assert_not_in_epsilon
(expected, actual, delta=nil, message=nil)Defined at lib/difects/unit.rb:36
assert_not_include
(item, collection, message=nil)Defined at lib/difects/unit.rb:47
assert_not_instance_of
(klass, object, message=nil)Defined at lib/difects/unit.rb:52
assert_not_kind_of
(klass, object, message=nil)Defined at lib/difects/unit.rb:57
assert_not_match
(pattern, string, message=nil)Defined at lib/difects/unit.rb:67
assert_not_nil
(object, message=nil)Defined at lib/difects/unit.rb:62
assert_not_operator
(object, operator, operand, message=nil)Defined at lib/difects/unit.rb:77
assert_not_raise
(*args, &block)Defined at lib/difects/unit.rb:82
assert_not_respond_to
(object, query, message=nil)Defined at lib/difects/unit.rb:86
assert_not_same
(expected, actual, message=nil)Defined at lib/difects/unit.rb:72
assert_not_send
(object, query, *args)Defined at lib/difects/unit.rb:95
assert_not_throw
(symbol, message=nil, &block)Defined at lib/difects/unit.rb:91
assert_operator
(object, operator, operand, message=nil)Defined at lib/difects/unit.rb:77
assert_raise
(*args, &block)Defined at lib/difects/unit.rb:82
assert_respond_to
(object, query, message=nil)Defined at lib/difects/unit.rb:86
assert_same
(expected, actual, message=nil)Defined at lib/difects/unit.rb:72
assert_send
(object, query, *args)Defined at lib/difects/unit.rb:95
assert_throw
(symbol, message=nil, &block)Defined at lib/difects/unit.rb:91
setup
(*args, &block)Defined at lib/difects.rb:1126
setup!
(*args, &block)Defined at lib/difects.rb:1126
teardown
(*args, &block)Defined at lib/difects.rb:1126
teardown!
(*args, &block)Defined at lib/difects.rb:1126
test
(*args, &block)Defined at lib/difects.rb:1126
This library emulates Minitest by adding the following methods to the
DIFECTS
module.
refute
(*args, &block)Defined at lib/difects.rb:1126
refute_empty
(collection, message=nil)Defined at lib/difects/unit.rb:26
refute_equal
(expected, actual, message=nil)Defined at lib/difects/unit.rb:31
refute_in_delta
(expected, actual, delta=nil, message=nil)Defined at lib/difects/unit.rb:36
refute_in_epsilon
(expected, actual, delta=nil, message=nil)Defined at lib/difects/unit.rb:36
refute_include
(item, collection, message=nil)Defined at lib/difects/unit.rb:47
refute_instance_of
(klass, object, message=nil)Defined at lib/difects/unit.rb:52
refute_kind_of
(klass, object, message=nil)Defined at lib/difects/unit.rb:57
refute_match
(pattern, string, message=nil)Defined at lib/difects/unit.rb:67
refute_nil
(object, message=nil)Defined at lib/difects/unit.rb:62
refute_operator
(object, operator, operand, message=nil)Defined at lib/difects/unit.rb:77
refute_raise
(*args, &block)Defined at lib/difects/unit.rb:82
refute_respond_to
(object, query, message=nil)Defined at lib/difects/unit.rb:86
refute_same
(expected, actual, message=nil)Defined at lib/difects/unit.rb:72
refute_send
(object, query, *args)Defined at lib/difects/unit.rb:95
refute_throw
(symbol, message=nil, &block)Defined at lib/difects/unit.rb:91
This library emulates Readability by adding the following methods to the
DIFECTS
module.
Catch
(*args, &block)Defined at lib/difects.rb:1126
Catch!
(*args, &block)Defined at lib/difects.rb:1126
Catch?
(*args, &block)Defined at lib/difects.rb:1126
Describe
(*args, &block)Defined at lib/difects.rb:1126
Describe!
(*args, &block)Defined at lib/difects.rb:1126
Error
(*args, &block)Defined at lib/difects.rb:1126
Error!
(*args, &block)Defined at lib/difects.rb:1126
Error?
(*args, &block)Defined at lib/difects.rb:1126
False
(*args, &block)Defined at lib/difects.rb:1126
False!
(*args, &block)Defined at lib/difects.rb:1126
False?
(*args, &block)Defined at lib/difects.rb:1126
Inform
(*args, &block)Defined at lib/difects.rb:1126
Inform!
(*args, &block)Defined at lib/difects.rb:1126
Share
(*args, &block)Defined at lib/difects.rb:1126
Share!
(*args, &block)Defined at lib/difects.rb:1126
Share?
(*args, &block)Defined at lib/difects.rb:1126
True
(*args, &block)Defined at lib/difects.rb:1126
True!
(*args, &block)Defined at lib/difects.rb:1126
True?
(*args, &block)Defined at lib/difects.rb:1126
Begin by loading DIFECTS into your program:
require 'rubygems' # might not be necessary; see HACKING
require 'difects'
You now have access to the DIFECTS
module, whose methods can be called
directly:
DIFECTS.D "hello" do # D() is a class method
puts "world"
end
or mixed-in and called implicitly:
include DIFECTS # mix-in the DIFECTS module
D "hello" do # D() is an instance method
puts "world"
end
according to your preference.
When the following test is run:
require 'difects/auto'
D 'Wizard' do
I 'Preparing spell to defeat mortal foes...'
end
D 'Magician' do
I 'Preparing rabbits to pull from hat...', rand(15)
end
D 'Calculator' do
I Math::PI, [1, 2, 3, ['a', 'b', 'c']], {:foo => 'bar!'}
end
DIFECTS will output the following:
---
- Wizard:
- Preparing spell to defeat mortal foes...
- Magician:
- Preparing rabbits to pull from hat...
- 14
- Calculator:
- 3.141592653589793
- - 1
- 2
- 3
- - a
- b
- c
- foo: bar!
---
time: 0.002947349
When the following test is run:
require 'difects/auto'
S :knowledge do
I 'Knowledge is power!'
end
D 'Healer' do
S :knowledge
end
D 'Warrior' do
S! :strength do
I 'Strength is power!'
end
end
D 'Wizard' do
S :knowledge
S :strength
end
D 'King' do
T { S? :knowledge }
T { S? :strength }
F { S? :power }
I 'Power is power!'
end
DIFECTS will output the following:
---
- Healer:
- Knowledge is power!
- Warrior:
- Strength is power!
- Wizard:
- Knowledge is power!
- Strength is power!
- King:
- Power is power!
---
pass: 3
time: 0.007106484
When the following test is run:
require 'difects/auto'
D "a root-level test" do
@outside = 1
T { defined? @outside }
T { @outside == 1 }
D "an inner, non-insulated test" do
T { defined? @outside }
T { @outside == 1 }
end
D! "an inner, insulated test" do
F { defined? @outside }
F { @outside == 1 }
@inside = 2
T { defined? @inside }
T { @inside == 2 }
end
F { defined? @inside }
F { @inside == 2 }
end
DIFECTS will output the following:
---
- a root-level test:
- an inner, non-insulated test:
- an inner, insulated test:
---
pass: 10
time: 0.007744531
This section is meant for people who want to develop DIFECTS's source code.
Install Ruby libraries necessary for development:
gem install difects --development
Inochi serves as the project infrastructure for DIFECTS. It handles tasks such as building this help manual and API documentation, and packaging, announcing, and publishing new releases. See its help manual and list of tasks to get started:
inochi --help # display help manual
inochi --tasks # list available tasks
Ensure that the lib/
directory is listed in Ruby's $LOAD_PATH
before you
use any libraries therein or run any executables in the bin/
directory.
This can be achieved by passing an option to Ruby:
ruby -Ilib bin/difects
irb -Ilib -r difects
Or by setting the $RUBYLIB
environment variable:
export RUBYLIB=lib # bash, ksh, zsh
setenv RUBYLIB lib # csh
set -x RUBYLIB lib # fish
ruby bin/difects
irb -r difects
Or by installing the ruby-wrapper tool.
If you use Ruby 1.8 or older, then ensure that RubyGems is activated before
you use any libraries in the lib/
directory or run any executables in the
bin/
directory.
This can be achieved by passing an option to Ruby:
ruby -rubygems bin/difects
irb -rubygems -r difects
Or by setting the $RUBYOPT
environment variable:
export RUBYOPT=-rubygems # bash, ksh, zsh
setenv RUBYOPT -rubygems # csh
set -x RUBYOPT -rubygems # fish
Simply execute the included test runner, which sets up Ruby's $LOAD_PATH
for
testing, loads the included test/test_helper.rb
file, and then evaluates all
test/**/*_test.rb
files:
test/runner
Its exit status will indicate whether all tests have passed. It may also
print additional pass/fail information depending on the testing library used
in the test/test_helper.rb
file.
Fork this project on GitHub (see Resources above) and send a pull request.
This section contains release notes of current and past releases.
This release renames the project to "DIFECTS", reduces cruft, improves the presentation and debuggability of assertion failures, and revises the manual.
Thank you:
Incompatible changes:
Rename project from "Dfect" to "DIFECTS", which stands for:
D
escribe, I
nform, F
alse, E
rror, C
atch, T
rue, S
hare
Remove ruby-debug integration because it is only helpful if you run a program inside it from the very start! That is, you cannot start ruby-debug in the middle of a program and expect it to know about the call stack that lead up to that point in the program. Instead, we now use IRB to inspect program state at the point of failure only.
Remove --quiet
option because user can pipe to /dev/null instead.
Rename run()
to start()
to better complement stop()
. The run()
method no longer clears test results; use reset()
for that.
Rename L()
to I()
as in "inform" the user.
Replace options()
with debug()
.
Replace report()
with trace()
and stats()
.
Rename the difects/full
library to difects/long
.
Do not report instance variables in assertion failures.
New features:
Improve debuggability by tracking the bindings of all lines of code
executed leading up to the point of failure using Ruby's
awesome set_trace_func
facility.
This allows block-less assertions to be debugged with the same level of accuracy as normal block-given assertions:
x = 1
y = 3
T { x == y } # a block-given assertion
T x == y # a block-less assertion
In both cases, you will be able to inspect the local variables x and y!
Add I!()
method to start the interactive debugger anywhere in your tests.
Add reset()
to manually clear previous test results.
Alias test()
to D()
in Test::Unit emulation layer.
Fallback to pp()
if to_yaml()
fails while reporting failures.
Use OrderedHash library in Ruby versions older than 1.9 for consistent presentation of information in assertion failures.
Show full failure details before starting debugger instead of omitting the backtrace and local variables listing.
Use PP to pretty-print variable values in failure details.
Omit unavailable information from failure details.
Put backtrace above code listing and variables in failure details.
Prevent empty array leaf nodes in execution trace.
Bug fixes:
Make DIFECTS
module's instance methods available as class methods.
Always display fail trace before entering debugger.
Always clear test execution internals after start()
.
Prevent IRB re-initialization errors when starting debugger.
Housekeeping:
Clarify how to mix-in modules inside insulated tests in the manual.
Thanks to Gavin Sinclair for reporting this issue.
Document methods (with hyperlinks to the location in the source code where they are defined) provided by emulation layers in manual.
Talk about passing condition as first argument to T
and F
assertions
and provide a code example in the manual.
Clean up the code and revise the manual. Yay!
This release adds a UNIX manual page and a sub-library for full method names.
New features:
Add dfect/full
sub-library that provides full name aliases to Dfect's
abbreviated vocabulary:
D
escribe, T
rue, F
alse, E
rror, C
atch, S
hare, and L
og.
Run dfect --help
to see the UNIX manual page!
Housekeeping:
This release adds a command-line test runner and performs some minor housekeeping.
New features:
bin/dfect
executable as command-line interface to this library.Housekeeping:
Do not require 'rubygems'
before loading the "ruby-debug" library.
Upgrade to Inochi 2.0.0-rc2 for managing this project.
This release adds the ability to insulate tests from each other, share code between them, makes the order of parameters consistent in the API, improves user interactivity, fixes some bugs, and revises the user manual.
Incompatible changes:
Root-level calls to the Dfect::D()
method are automatically insulated now.
The Dfect::E()
methods now expects its optional message
parameter to be the last parameter in the parameter list.
The Dfect::C()
methods now expect their first parameter to
be a symbol instead of the optional message to be shown in
case of assertion failure.
The Dfect::R()
has been renamed to Dfect::L()
,
which is a mnemonic for "Logging".
Shorten names of hash keys in the execution trace for brevity
and rename :raise
key in report statistics to :error
.
Only the most helpful subset of the failure details is shown before placing the user into a debugger because they can query the omitted information (on demand) inside the debugger.
The execution trace is only shown if all tests passed in Dfect::run()
.
The :debug
option is now set to Ruby's $DEBUG
global by default.
New features:
Print failures as they occur instead of waiting until the end.
Allow passing condition as argument to true/false assertions instead of requiring the condition to be passed as a code block, and also fall back to the binding of inner-most enclosing test or hook when debugging or constructing a failure report for an assertion that was not given a block.
This allows you to reduce "line noise" in your tests:
D "Lottery" do
winning_ticket = rand()
D "My chances of winning" do
my_ticket = rand()
F my_ticket == winning_ticket, "I won?! Dream on."
end
end
Add Dfect::S()
methods for sharing code between tests.
Add Dfect::D!()
method to explicitly insulate a test from other
tests, the top-level Ruby environment, and the code being tested.
Add Dfect::info()
method which returns the details of
the failure that is currently being debugged by the user.
Add instance variables to the :vars
section of a failure report.
Add setup!()
and teardown!()
methods for before-all and
after-all hooks in the dfect/unit emulation library.
Add test execution time to statistics hash (under the :time
key).
Bug fixes:
Do not print any output when :quiet
option is active.
Allow passing multiple strings/objects to Dfect::D()
like in RSpec.
Make before and after hook methods mixin-able like assertions.
Do not assume that Module#to_s
is the same as Module#name
.
Housekeeping:
Upgrade to Inochi 2.0.0-rc1 for managing this project.
Make emulation libraries modify Dfect module instead of Kernel.
Do not pollute the user's output with our Class#to_yaml
workaround.
Remove "Motivation" section from user manual. It was too fanatic!
This release adds a new method for emitting status messages and does some internal housekeeping.
Thank you:
New features:
Dfect::S()
method for adding status messages to the
execution report. This feature was requested
by Iñaki Baz Castillo.Housekeeping:
Remove unused require of 'delegate' standard library in 'dfect/spec' RSpec emulation layer.
Mention emulation layers for popular testing libraries.
Mention that assertions take an optional message parameter.
Replace sample unit test with Dfect test suite.
Upgrade user manual to ERBook 9.0.0.
This release fixes a bug in the Test::Unit emulation library and revises the user manual.
Bug fixes:
assert_equal()
method in the
dfect/unit library were in the wrong order.Housekeeping:
Revise user manual to better fit jQuery UI tabs.
Justify the use of eval()
in emulation libraries.
Use simpler Copyright reminder at the top of every file.
Make SLOC count in user manual reflect the core library only.
Mark code spans with {:lang=ruby}
instead of HTML <code/>
tags.
Open source is for fun, so be nice and speak of "related works" instead of "competitors".
This release improves default choices, adds emulation layers to mimic other testing libraries, and fixes some bugs.
Incompatible changes:
The :debug
option is now enabled by default and is no longer linked to
the value of $DEBUG
.
Dfect.run()
now appends to previous results by default.
This behavior can be disabled by passing false
to the method.
New features:
Bug fixes:
Class#to_yaml
; it might be fixed someday.Housekeeping:
Add "Motivation" section in user manual to promote interactive debugging.
Add brief History of this project's inception.
Remove redundant assertions for F!() and T!() methods in test suite.
Add copyright notice at the top of every file.
This release adds new variations to assertion methods, fixes several bugs, and improves test coverage.
Thank you:
New features:
Added negation (m!) and sampling (m?) variations to normal assertion methods. These new methods implement assertion functionality missing so far (previously we could not assert that a given exception was NOT thrown) and thereby allow us to fully test Dfect using itself.
Added documentation on how to insulate tests from the global Ruby namespace.
Bug fixes:
The E()
method did not consider the case where a block does not raise
anything as a failure. ---François Beausoleil
When creating a report about an assertion failure, an exception would be thrown if any local variables pointed to an empty array.
The Dfect::<()
method broke the inheritance-checking behavior of the <
class method.
Added a bypass to the originial behavior so that RCov::XX
can properly
generate a report about code that uses Dfect.
Added workaround for YAML error when serializing a class object:
TypeError: can't dump anonymous class Class
Housekeeping:
For the longest time, I took Test::Unit and RSpec for granted. They were the epitomy of modern Ruby practice; the insurmountable status quo; immortalized in books, conferences, and blogs alike.
Why would anyone think of using anything remotely different, let alone be foolish enough to write an alternative testing library when these are clearly good enough?
Recent experiments in assertion testing libraries smashed my world view:
The status quo was certainly not "good enough", as I had so blindly believed all these years. In fact, they were verbose behemoths that chose to encode endless permutations of conjecture into methods.
Empowered by this revelation and inspired by Sean O'Halpin's musing on alternative names for assertion methods, I rose to challenge the status quo.
And so I present to you the first public release of "Dfect".
Suraj N. Kurapati
François Beausoleil, Gavin Sinclair, Iñaki Baz Castillo, Sean O'Halpin
(the ISC license)
Copyright 2009 Suraj N. Kurapati sunaku@gmail.com
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.