about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* 3024Kartik K. Agaram2016-05-281-1/+1
|
* 3023Kartik K. Agaram2016-05-281-1/+1
|
* 3022Kartik K. Agaram2016-05-274-20/+79
| | | | Clean up 3020.
* 3021Kartik K. Agaram2016-05-274-101/+120
|
* 3020 - names in chessboard testsKartik K. Agaram2016-05-263-96/+118
| | | | | | | | Extremely ugly change. Also ended up fixing some places where I was mixing up sources and sinks. But I'm not going to bother updating edit/ and sandbox/ apps. Just too many scenarios to clean up.
* 3018Kartik K. Agaram2016-05-261-5/+2
|
* 3017Kartik K. Agaram2016-05-268-648/+696
|
* 3016Kartik K. Agaram2016-05-261-2/+2
|
* 3015 - more symbolic names in testsKartik K. Agaram2016-05-267-521/+569
| | | | | | There's still a problem: if I ever want to use any of the special scenario variables like 'screen', 'console', etc., then I can't use 'local-scope' in my scenario.
* 3014Kartik K. Agaram2016-05-261-126/+126
| | | | | Tests are clearer if memory locations look different from other literal values.
* 3013Kartik K. Agaram2016-05-2612-342/+356
|
* 3012Kartik K. Agaram2016-05-261-209/+255
| | | | Clean up old tests after https://news.ycombinator.com/item?id=11779013
* 3011Kartik K. Agaram2016-05-251-0/+0
|
* 3010Kartik K. Agaram2016-05-251-2/+2
| | | | | | | | | | insert_container is getting pretty gnarly. It's spread across two layers (containers and shape-shifting containers), and since it has to deal with extending existing containers it's coiled in on itself, constantly reading and writing the Type table. Maybe I should uncoil the case of extending a container and make it separate from defining a new container.
* 3009Kartik K. Agaram2016-05-251-2/+6
|
* 3008Kartik K. Agaram2016-05-252-5/+5
|
* 3007 - warn on unused result in 'not'Kartik K. Agaram2016-05-251-2/+2
|
* 3006Kartik K. Agaram2016-05-242-8/+9
|
* 3005Kartik K. Agaram2016-05-241-32/+0
| | | | | | Drop those tests now that we've confirmed over the last few commits that they work. The new test introduced in the bugfix of commit 3003 takes over their duties.
* 3004 - print non-integers correctlyKartik K. Agaram2016-05-241-74/+27
| | | | | | Thanks Caleb Couch for finding this hole, and for noticing that it made a bug in binary-search harder to find. For now we'll just rely on the host's support for printing floating-point.
* 3003Kartik K. Agaram2016-05-242-2/+32
| | | | | | Bugfix: overriding a primitive recipe with a generic variant that takes an address of something shouldn't mask the primitive when you call it with literal 0.
* 3002Kartik K. Agaram2016-05-241-0/+1
|
* 3001Kartik K. Agaram2016-05-243-11/+18
|
* 3000Kartik K. Agaram2016-05-241-1/+1
|
* 2999Kartik K. Agaram2016-05-241-2/+2
|
* 2998Kartik K. Agaram2016-05-242-4/+8
|
* 2997 - new version of http://akkartik.name/aboutKartik K. Agaram2016-05-232-7/+7
|
* 2996Kartik K. Agaram2016-05-2177-2858/+5390
|
* 2995Kartik K. Agaram2016-05-211-0/+15
|
* 2994Kartik K. Agaram2016-05-211-1/+1
|
* 2993 - mutable check for pass-by-value containersKartik K. Agaram2016-05-211-4/+23
| | | | This fixes all known holes in the immutability checker.
* 2992Kartik K. Agaram2016-05-203-1/+29
| | | | | Raise an error if a 'put' or 'put-index' doesn't match ingredient and product. That wouldn't do what you would expect.
* 2991Kartik K. Agaram2016-05-203-7/+7
| | | | | Never mind, always quote direct quotes from code in error messages. Dilated reagents are the uncommon case.
* 2990Kartik K. Agaram2016-05-2044-291/+281
| | | | | | | | | | Standardize quotes around reagents in error messages. I'm still sure there's issues. For example, the messages when type-checking 'copy'. I'm not putting quotes around them because in layer 60 I end up creating dilated reagents, and then it's a bit much to have quotes and (two kinds of) brackets. But I'm sure I'm doing that somewhere..
* 2988 - bring back immutability checksKartik K. Agaram2016-05-201-0/+544
| | | | | | These were dropped back in commit 2858 (Apr 23). There are still holes in immmutability checking, this just brings us back to parity while using put/put-index instead of get-address/index-address.
* 2987Kartik K. Agaram2016-05-207-0/+0
|
* 2986 - new example: the 8-queens problemKartik K. Agaram2016-05-202-0/+100
| | | | Just playing around with edit/ and trying to find bugs.
* 2985 - allow multiple pointers within listsKartik K. Agaram2016-05-201-3/+2
| | | | | | | | | | Earlier, this wasn't legal: y:address:list:number <- push 34, x:address:list:number (So that x and y would point to different places in the list.) However, functional code relies on this ability a lot.
* 2984Kartik K. Agaram2016-05-191-0/+272
| | | | Missed a file.
* 2983 - migrate buttons over to sandbox/Kartik K. Agaram2016-05-1914-384/+366
|
* 2982Kartik K. Agaram2016-05-1class="n">x)) self.assertEqual( [1,2,3], u([1,2,3])) self.assertEqual( [1,2,3], u([1,2,3,2,1])) self.assertEqual( [1,2,3], u([1,2,3,1,2,3,2,2,3,1,2,3,1,2,3,2,3,2,1])) self.assertEqual( [1,[2,3]], u([1,[2,3],1,[2,3],[2,3],1,[2,3],1,[2,3],[2,3],1])) def test_unique_keeps_type(self): def u(x): return unique(x) self.assertEqual( [1,2,3], u([1,2,3,1])) self.assertEqual( (1,2,3), u((1,2,3,1))) self.assertEqual( set((1,2,3)), u(set((1,2,3,1)))) self.assertEqual( deque((1,2,3)), u(deque((1,2,3,1)))) def test_mount_path(self): # assuming ismount() is used def my_ismount(path): depth = path.count('/') if path.startswith('/media'): return depth == 0 or depth == 2 return depth <= 1 from ranger.ext import mount_path original_ismount = mount_path.ismount mount_path.ismount = my_ismount try: mp = mount_path.mount_path self.assertEqual('/home', mp('/home/hut/porn/bondage')) self.assertEqual('/', mp('/')) self.assertEqual('/media/sdb1', mp('/media/sdb1/foo/bar')) self.assertEqual('/media/sdc2', mp('/media/sdc2/a/b/c/d/e')) finally: mount_path.ismount = original_ismount # TODO: links are not tested but I don't see how its possible # without messing around with mounts. # self.assertEqual('/media/foo', # mount_path('/media/bar/some_link_to_a_foo_subdirectory')) def test_openstruct(self): from ranger.ext.openstruct import OpenStruct from random import randint, choice from string import ascii_letters os = OpenStruct(a='a') self.assertEqual(os.a, 'a') self.assertRaises(AttributeError, getattr, os, 'b') dictionary = {'foo': 'bar', 'zoo': 'zar'} os = OpenStruct(dictionary) self.assertEqual(os.foo, 'bar') self.assertEqual(os.zoo, 'zar') self.assertRaises(AttributeError, getattr, os, 'sdklfj') for i in range(100): attr_name = ''.join(choice(ascii_letters) \ for x in range(randint(3,9))) value = randint(100,999) if not attr_name in os: self.assertRaises(AttributeError, getattr, os, attr_name) setattr(os, attr_name, value) value2 = randint(100,999) setattr(os, attr_name, value2) self.assertEqual(value2, getattr(os, attr_name)) def test_shell_escape(self): from ranger.ext.shell_escape import shell_escape, shell_quote self.assertEqual(r"'luigi'\''s pizza'", shell_quote("luigi's pizza")) self.assertEqual(r"luigi\'s\ pizza", shell_escape("luigi's pizza")) self.assertEqual(r"\$lol/foo\\xyz\|\>\<\]\[", shell_escape(r"$lol/foo\xyz|><][")) if __name__ == '__main__': unittest.main()