summary refs log tree commit diff stats
path: root/c/space-age/src
ModeNameSize
-rw-r--r--space_age.c1301log stats plain blame
-rw-r--r--space_age.h230log stats plain blame
;vc@akkartik.com> 2022-05-22 18:29:52 -0700 basic test-enabled framework' href='/akkartik/view.love/commit/test.lua?id=f421e1daa52a52956f40b3ee6d8b527ba1c30d5a'>f421e1d ^
23e9be3 ^
2a0a770 ^
23e9be3 ^



f421e1d ^
2a0a770 ^
bc95ec4 ^
f421e1d ^







a8a8965 ^
f421e1d ^



a8a8965 ^
f421e1d ^






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
                             

                      
               



              
                          
                  



                                                   
                                   
                             
                                                                







                                             
                             



                           
                             






                    
-- Some primitives for tests.

function check(x, msg)
  if not x then
    error(msg)
  end
end

function check_nil(x, msg)
  if x ~= nil then
    error(msg..'; should be nil but got "'..x..'"')
  end
end

function check_eq(x, expected, msg)
  if not eq(x, expected) then
    error(msg..'; should be "'..expected..'" but got "'..x..'"')
  end
end

function eq(a, b)
  if type(a) ~= type(b) then return false end
  if type(a) == 'table' then
    if #a ~= #b then return false end
    for k, v in pairs(a) do
      if not eq(b[k], v) then
        return false
      end
    end
    for k, v in pairs(b) do
      if not eq(a[k], v) then
        return false
      end
    end
    return true
  end
  return a == b
end