Looks like C++ and C# return their tests in alphabetical order.
int a = 1;
Describe(alphabetical_order)
{
It(b)
{
Assert::That(1, Equals(1));
}
It(c)
{
Assert::That(1, Equals(1));
}
It(a)
{
Assert::That(1, Equals(1));
}
It(d)
{
Assert::That(1, Equals(1));
}
};
There seems to be an error with looking at the top of a stack, but it doesn't throw. It just kills execution. What's going on here?
#include <stack>
bool method()
{
std::stack<int> my_stack;
//my_stack.push(1);
try {
if(my_stack.top())
{
}
}
catch(...) {
std::cout << "An Exception Occurred" << std::endl;
}
return true;
}
Describe(check_the_stack)
{
It(should_do_something)
{
Assert::That(method(), Equals(true));
}
};
arr2bin=(arr)->
if arr.filter( (n)-> !(n%1==0) ).length
return '0'
sum = arr.map((x)-> if typeof x =="number" then x else 0).reduce((x,y)->(x+y))
return sum.toString(2);
Test.expect(arr2bin([1,2,3]), "It works")