aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_eval.rb
Commit message (Collapse)AuthorAgeFilesLines
* test/ruby: suppress parser warningsnobu2016-02-191-4/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * proc.c (rb_block_clear_env_self): clear by Qfalse intead of Qnil.ko12015-08-041-0/+10
| | | | | | | | | | | [Bug #11409] * test/ruby/test_eval.rb: add tests for this issue, written by @0x0dea. https://github.com/ruby/ruby/pull/988 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_eval.rb: add case to test "sticky" instance_evalheadius2014-12-021-0/+9
| | | | | | self when passed a reified block (proc/lambda). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/lib/envutil.rb: Moved from test/ruby/.akr2014-11-131-1/+0
| | | | | | | | | | | | | | * test/lib/find_executable.rb: Ditto. * test/lib/memory_status.rb: Ditto. * test/lib/test/unit.rb: require envutil. * test/: Don't require envutil in test files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h, vm.c, proc.c: fix GC mark miss on bindings.ktsj2014-10-181-0/+15
| | | | | | | | [ruby-dev:48616] [Bug #10368] * test/ruby/test_eval.rb: add a test code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: freeze nil/true/false.ko12014-09-111-5/+5
| | | | | | | | | | | | | | | | | * gc.c (should_be_finalizable): check frozen after checkin FL_ABLE. * object.c (rb_obj_taint): check OBJ_TAINTABLE(obj). * object.c (rb_obj_freeze): remove immediate_frozen_tbl because all of immediate values are frozen. YAY! * object.c (rb_obj_frozen_p): ditto. * test/ruby/test_eval.rb: skip instance_variable_set for frozen objects. * test/ruby/test_weakmap.rb: check ArgumentError instead of RuntimeError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_eval.rb (TestEval#make_test_binding): renamed.usa2014-03-041-2/+2
| | | | | | | it's not test method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_eval.rb (class TestEval): Use assert_same instead oftmm12013-11-271-2/+1
| | | | | | | | assert_equal. * test/ruby/test_hash.rb (class TestHash): ditto. * test/ruby/test_iseq.rb (class TestISeq): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_eval.rb (class TestEval): Add test for shared evaltmm12013-11-271-0/+12
| | | | | | | | filenames via rb_fstring(). * test/ruby/test_iseq.rb (class TestISeq): Add test for shared iseq labels via rb_fstring(). [Bug #9159] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: make Symbol objects frozen.ko12013-09-191-1/+1
| | | | | | | | | | | [Feature #8906] I want to freeze this good day, too. * test/ruby/test_eval.rb: catch up this change. * test/ruby/test_symbol.rb: add a test to check frozen symbols. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y, vm_eval.c: file encoding in evalnobu2013-07-291-0/+5
| | | | | | | | | | | | | | * parse.y (yycompile): store file name as String to keep the encoding. * parse.y (rb_parser_compile_string_path, rb_parser_compile_file_path): new functions to pass file name as a String. * parse.y (gettable_gen): return a copy of the original file name, not a copy in filesystem encoding. * vm_eval.c (eval_string_with_cref): use Qundef instead of "(eval)". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo2013-06-121-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* class.c: suppress wrong warningnobu2013-03-301-0/+7
| | | | | | | | * class.c (HAVE_METACLASS_P): should check FL_SINGLTON flag before get instance variable to get rid of wrong warning about __attached__. [ruby-core:53839] [Bug #8188] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* proc.c: main.define_methodnobu2012-11-011-0/+18
| | | | | | | | * proc.c (top_define_method): new method, main.define_method. [ruby-core:45715] [Feature #6609] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (bignew_1): Bignum instances are frozen.ko12012-10-281-1/+1
| | | | | | | | | | | | | | | Feature #3222 * include/ruby/ruby.h: Fixnum instances are also frozen. * class.c (singleton_class_of): check Bignum before singleton cheking. * test/ruby/test_bignum.rb: add a test. * test/ruby/test_fixnum.rb: ditto. * test/ruby/marshaltestlib.rb, test/ruby/test_eval.rb, test/ruby/test_object.rb: catch up above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_eval.c: cref-scope hacknobu2012-08-081-0/+12
| | | | | | | | * vm_eval.c (eval_under): singletons other than special constants don't need cref-scope hack. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use local variablesnobu2012-08-081-22/+22
| | | | | | | | | | | * test/ruby/test_eval.rb: use local variables instead global variables if possible. * test/ruby/test_ifunless.rb: ditto. * test/ruby/test_iterator.rb: ditto. * test/ruby/test_stringchar.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* method in instance_evalnobu2012-08-061-0/+15
| | | | | | | | | | | | * class.c (rb_special_singleton_class_of): utility function. * vm_eval.c (eval_under): special deal for class variable scope with instance_eval. * vm_eval.c (rb_obj_instance_eval, rb_obj_instance_exec): allow method definition in instance_eval of special constants. [ruby-core:28324] [Bug #2788] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_eval.rb: adjust indentnobu2012-07-191-46/+46
| | | | | | | | * test/ruby/test_eval.rb (test_instance_eval_{string,block}_basic): adjust indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_eval.rb: use blocknobu2012-07-191-10/+6
| | | | | | | * test/ruby/test_eval.rb (forall_TYPE): use block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_cref_push): no outer cref is needed for procnobu2010-09-231-0/+15
| | | | | | from method. Bug #3786, Bug #3860, [ruby-core:32501] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (lex_get_str, lex_io_gets, rb_parser_compile_string):nobu2009-08-171-0/+7
| | | | | | | must be ascii compatible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * {ext,lib,test}/**/*.rb: removed trailing spaces.nobu2009-03-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_eval.rb: add new test.usa2008-12-251-0/+17
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, vm_insnhelper.c: fix cref in instance_evalko12008-05-191-7/+10
| | | | | | | | | | | and cvar_base search protocol. * bootstraptest/test_knownbug.rb, test_eval.rb: move soleved test and add new tests. * test/ruby/test_eval.rb: fix tests for spec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_eval.rb (test_define_method_block): new testnobu2008-05-171-0/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_object.rb: new tests to achieve over 90% testmame2008-05-141-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | coverage of object.c, eval.c and eval_method.c. * test/ruby/test_module.rb: ditto. * test/ruby/test_trace.rb: ditto. * test/ruby/test_integer.rb: ditto. * test/ruby/test_float.rb: ditto. * test/ruby/test_method.rb: ditto. * test/ruby/test_variable.rb: ditto. * test/ruby/test_eval.rb: ditto. * test/ruby/test_exception.rb: ditto. * test/ruby/test_class.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_obj_instance_eval): use class of immediate objects.ko12007-12-221-1/+1
| | | | | | | | * test/ruby/test_eval.rb: fix a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_eval.rb: class variable test updated.matz2007-12-211-12/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_eval.rb (TestEval::test_instance_eval_cvar):matz2007-11-261-15/+5
| | | | | | updated not to modify class variable of Object class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use ML ref. for assertion message.akr2007-11-181-8/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_f_send): allow send/__send__ to call methods of allmatz2007-11-041-2/+2
| | | | | | | | | | visibility again. we no longer provide __send, __send!. * eval.c (rb_invoke_method): new method to honor private visibility. if it's invoked in a function call style, it calls private methods as well (previous 1.9 send behavior). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_dir.rb (TestDir::setup): ?c now makes a string.matz2007-08-241-2/+2
| | | | | | | | | | * lib/test/unit/autorunner.rb (Test::Unit::AutoRunner::initialize): initialize @workdir to stop warning. * lib/drb/drb.rb (DRb::DRbServer::InvokeMethod::perform_without_block): replace funcall by send!. other files in the distribution as well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * Merge YARVko12006-12-311-27/+246
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/tk/lib/tk/font.rb, ext/tk/lib/tkextlib/ICONS/icons.rb,nobu2005-10-221-1/+1
| | | | | | | | | | | | ext/tk/sample/tkextlib/treectrl/demo.rb, lib/net/imap.rb, lib/rss/parser.rb, test/rss/test_content.rb, test/rss/test_dublincore.rb, test/rss/test_syndication.rb, test/rss/test_trackback.rb, test/ruby/test_eval.rb, test/socket/test_socket.rb, test/socket/test_udp.rb: Object#fcall was renamed as Object#funcall. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb (new_ostruct_member): Object#send no longer callnobu2005-09-121-1/+1
| | | | | | | | | | | | | private methods. [ruby-dev:27044] * test/rss/test_dublincore.rb, test/rss/test_trackback.rb, test/ruby/test_eval.rb, test/socket/test_socket.rb: ditto. * test/ruby/test_lambda (test_call_with_block): lambda makes new scope for formal block parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add test for [ruby-dev:24060], [ruby-dev:24065], [ruby-dev:24103],akr2004-09-071-0/+35
| | | | | | | | [ruby-dev:24190], [ruby-dev:24191], [ruby-dev:24194], [ruby-dev:24197], [ruby-dev:24202], [ruby-dev:24213], [ruby-dev:24223] and [ruby-dev:24228]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/*: should not depend on $KCODE.nahi2004-02-181-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/optparse.rb (OptionParser#order, #permute, #parse): allow annobu2003-09-051-34/+34
| | | | | | | | | | array as argument. * test/ruby/test_*.rb: moved invariants to left side in assert_equal, and use assert_nil, assert_raises and so on. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_*.rb: replace 'assert(a == b)' with assert_equal(a, b)'nahi2003-09-051-24/+24
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby: tests for ruby itself.nahi2003-09-041-0/+124
* test/ruby/test_*.rb: split sample/test.rb into 28 test/unit testcases. some tests could not be translates... search '!!' mark to see it. * test/csv/test_csv.rb: should require 'csv', not '../lib/csv'. test runner should set load path correctly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e