'''
Testjes voor futoshiki.py
'''

from futoshiki import *

print 'Testjes voor futoshiki.py'


# from_text en print_sol test, geen return, zelf visueel checken... 
sol = from_text(nhd_10_10_2015)
print '-' * 79
for row in nhd_10_10_2015:
    print '     ' + row
print_sol(sol, 'TEST: from_text and print_sol')


# implace functies testen
sol = from_text(nhd_10_10_2015)

print_sol(sol, 'TEST: hebben we de juiste futoshiki geladen')
ans = [[[1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5]],
       [[1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5]],
       [[1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5]],
       [[1,2,3,4,5], [1,2,3,4,5], [  2      ], [1,2,3,4,5], [1,2,3,4,5]],
       [[1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5]]]

assert sol == ans, 'Fout from text of definitie'


inplace_strike_through_singles(sol)
print_sol(sol, 'TEST: inplace_strike_through_singles')
ans = [[[1,2,3,4,5], [1,2,3,4,5], [1,  3,4,5], [1,2,3,4,5], [1,2,3,4,5]],
       [[1,2,3,4,5], [1,2,3,4,5], [1,  3,4,5], [1,2,3,4,5], [1,2,3,4,5]],
       [[1,2,3,4,5], [1,2,3,4,5], [1,  3,4,5], [1,2,3,4,5], [1,2,3,4,5]],
       [[1,  3,4,5], [1,  3,4,5], [  2      ], [1,  3,4,5], [1,  3,4,5]],
       [[1,2,3,4,5], [1,2,3,4,5], [1,  3,4,5], [1,2,3,4,5], [1,2,3,4,5]]]

assert sol == ans, 'Fout in inplace_strike_through_singles'

inplace_strike_through_ltgt_row(sol)
print_sol(sol, 'TEST: inplace_strike_through_ltgt_row')
ans = [[[1,2,3,4  ], [1,2,3,4,5], [1,  3,4,5], [1,2,3,4,5], [1,2,3,4,5]],
       [[1,2,3,4,5], [1,2,3,4  ], [1,  3,4,5], [1,2,3,4,5], [1,2,3,4,5]],
       [[1,2,3,4,5], [1,2,3,4  ], [1,  3,4,5], [1,2,3,4,5], [1,2,3,4,5]],
       [[1,  3,4,5], [1,  3,4,5], [  2      ], [1,  3,4,5], [1,  3,4  ]],
       [[1,2,3,4  ], [1,2,3,4,5], [1,  3,4,5], [1,2,3,4  ], [1,2,3,4,5]]]

assert sol == ans, 'Fout in inplace_strike_through_ltgt_row'


inplace_strike_through_ltgt_col(sol)
print_sol(sol, 'TEST: inplace_strike_through_ltgt_col')
ans = [[[1,2,3,4  ], [1,2,3,4,5], [1,  3,4,5], [1,2,3,4,5], [1,2,3,4,5]],
       [[1,2,3,4  ], [1,2,3,4  ], [1,  3,4,5], [1,2,3,4,5], [1,2,3,4,5]],
       [[1,2,3,4,5], [1,2,3,4  ], [1,  3,4,5], [1,2,3,4,5], [1,2,3,4,5]],
       [[1,  3,4,5], [1,  3,4,5], [  2      ], [1,  3,4,5], [1,  3,4  ]],
       [[1,2,3,4  ], [1,2,3,4  ], [1,  3,4,5], [1,2,3,4  ], [1,2,3,   ]]]

assert sol == ans, 'Fout in inplace_strike_through_ltgt_col'