script_core 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rubocop.yml +8 -6
- data/.ruby-version +1 -1
- data/Gemfile +2 -1
- data/bin/sandbox +1 -1
- data/ext/enterprise_script_service/Rakefile +1 -1
- data/ext/enterprise_script_service/flags.rb +5 -0
- data/ext/enterprise_script_service/libseccomp/CHANGELOG +15 -0
- data/ext/enterprise_script_service/libseccomp/CREDITS +3 -0
- data/ext/enterprise_script_service/libseccomp/Makefile.am +1 -1
- data/ext/enterprise_script_service/libseccomp/README.md +1 -1
- data/ext/enterprise_script_service/libseccomp/SECURITY.md +45 -0
- data/ext/enterprise_script_service/libseccomp/configure.ac +3 -3
- data/ext/enterprise_script_service/libseccomp/doc/admin/MAINTAINER_PROCESS.md +95 -0
- data/ext/enterprise_script_service/libseccomp/{RELEASE_PROCESS.md → doc/admin/RELEASE_PROCESS.md} +9 -1
- data/ext/enterprise_script_service/libseccomp/include/Makefile.am +1 -1
- data/ext/enterprise_script_service/libseccomp/include/seccomp-syscalls.h +2292 -0
- data/ext/enterprise_script_service/libseccomp/include/seccomp.h.in +3 -1065
- data/ext/enterprise_script_service/libseccomp/src/arch-aarch64-syscalls.c +35 -3
- data/ext/enterprise_script_service/libseccomp/src/arch-arm-syscalls.c +35 -3
- data/ext/enterprise_script_service/libseccomp/src/arch-mips-syscalls.c +43 -11
- data/ext/enterprise_script_service/libseccomp/src/arch-mips64-syscalls.c +33 -1
- data/ext/enterprise_script_service/libseccomp/src/arch-mips64n32-syscalls.c +33 -1
- data/ext/enterprise_script_service/libseccomp/src/arch-parisc-syscalls.c +34 -2
- data/ext/enterprise_script_service/libseccomp/src/arch-ppc-syscalls.c +43 -11
- data/ext/enterprise_script_service/libseccomp/src/arch-ppc64-syscalls.c +44 -12
- data/ext/enterprise_script_service/libseccomp/src/arch-s390-syscalls.c +46 -14
- data/ext/enterprise_script_service/libseccomp/src/arch-s390.c +142 -18
- data/ext/enterprise_script_service/libseccomp/src/arch-s390x-syscalls.c +47 -15
- data/ext/enterprise_script_service/libseccomp/src/arch-s390x.c +143 -17
- data/ext/enterprise_script_service/libseccomp/src/arch-x32-syscalls.c +33 -1
- data/ext/enterprise_script_service/libseccomp/src/arch-x86-syscalls.c +94 -12
- data/ext/enterprise_script_service/libseccomp/src/arch-x86.c +142 -19
- data/ext/enterprise_script_service/libseccomp/src/arch-x86_64-syscalls.c +33 -1
- data/ext/enterprise_script_service/libseccomp/src/db.c +1 -0
- data/ext/enterprise_script_service/libseccomp/src/gen_bpf.c +10 -3
- data/ext/enterprise_script_service/libseccomp/src/python/Makefile.am +4 -4
- data/ext/enterprise_script_service/libseccomp/src/python/seccomp.pyx +2 -0
- data/ext/enterprise_script_service/libseccomp/tests/.gitignore +1 -0
- data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.c +98 -0
- data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.py +61 -0
- data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.tests +18 -0
- data/ext/enterprise_script_service/libseccomp/tests/Makefile.am +6 -3
- data/ext/enterprise_script_service/libseccomp/tools/Makefile.am +0 -2
- data/ext/enterprise_script_service/libseccomp/tools/check-syntax +1 -0
- data/ext/enterprise_script_service/libseccomp/tools/scmp_bpf_sim.c +2 -0
- data/ext/enterprise_script_service/mruby-mpdecimal/src/ext.c +1 -1
- data/ext/enterprise_script_service/mruby/.gitignore +2 -2
- data/ext/enterprise_script_service/mruby/CONTRIBUTING.md +10 -3
- data/ext/enterprise_script_service/mruby/Doxyfile +2408 -0
- data/ext/enterprise_script_service/mruby/README.md +21 -8
- data/ext/enterprise_script_service/mruby/Rakefile +4 -13
- data/ext/enterprise_script_service/mruby/appveyor_config.rb +1 -1
- data/ext/enterprise_script_service/mruby/build_config.rb +3 -3
- data/ext/enterprise_script_service/mruby/doc/guides/compile.md +42 -42
- data/ext/enterprise_script_service/mruby/doc/guides/debugger.md +1 -1
- data/ext/enterprise_script_service/mruby/doc/guides/mrbconf.md +45 -6
- data/ext/enterprise_script_service/mruby/doc/guides/mrbgems.md +5 -0
- data/ext/enterprise_script_service/mruby/doc/limitations.md +88 -38
- data/ext/enterprise_script_service/mruby/doc/mruby_logo_red_icon.png +0 -0
- data/ext/enterprise_script_service/mruby/doc/opcode.md +94 -94
- data/ext/enterprise_script_service/mruby/include/mrbconf.h +74 -11
- data/ext/enterprise_script_service/mruby/include/mruby.h +242 -146
- data/ext/enterprise_script_service/mruby/include/mruby/array.h +7 -7
- data/ext/enterprise_script_service/mruby/include/mruby/boxing_nan.h +2 -9
- data/ext/enterprise_script_service/mruby/include/mruby/boxing_no.h +11 -10
- data/ext/enterprise_script_service/mruby/include/mruby/boxing_word.h +104 -69
- data/ext/enterprise_script_service/mruby/include/mruby/class.h +7 -5
- data/ext/enterprise_script_service/mruby/include/mruby/common.h +9 -7
- data/ext/enterprise_script_service/mruby/include/mruby/compile.h +6 -6
- data/ext/enterprise_script_service/mruby/include/mruby/data.h +5 -5
- data/ext/enterprise_script_service/mruby/include/mruby/debug.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/dump.h +3 -7
- data/ext/enterprise_script_service/mruby/include/mruby/error.h +34 -6
- data/ext/enterprise_script_service/mruby/include/mruby/gc.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/hash.h +4 -11
- data/ext/enterprise_script_service/mruby/include/mruby/irep.h +16 -4
- data/ext/enterprise_script_service/mruby/include/mruby/istruct.h +4 -4
- data/ext/enterprise_script_service/mruby/include/mruby/khash.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/numeric.h +41 -7
- data/ext/enterprise_script_service/mruby/include/mruby/object.h +8 -9
- data/ext/enterprise_script_service/mruby/include/mruby/opcode.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/ops.h +6 -6
- data/ext/enterprise_script_service/mruby/include/mruby/proc.h +19 -13
- data/ext/enterprise_script_service/mruby/include/mruby/range.h +10 -4
- data/ext/enterprise_script_service/mruby/include/mruby/re.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/string.h +130 -107
- data/ext/enterprise_script_service/mruby/include/mruby/throw.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/value.h +137 -49
- data/ext/enterprise_script_service/mruby/include/mruby/variable.h +3 -5
- data/ext/enterprise_script_service/mruby/include/mruby/version.h +24 -10
- data/ext/enterprise_script_service/mruby/lib/mruby-core-ext.rb +2 -39
- data/ext/enterprise_script_service/mruby/lib/mruby/build.rb +32 -15
- data/ext/enterprise_script_service/mruby/lib/mruby/build/command.rb +63 -17
- data/ext/enterprise_script_service/mruby/lib/mruby/build/load_gems.rb +24 -10
- data/ext/enterprise_script_service/mruby/lib/mruby/gem.rb +11 -7
- data/ext/enterprise_script_service/mruby/lib/mruby/lockfile.rb +81 -0
- data/ext/enterprise_script_service/mruby/minirake +27 -11
- data/ext/enterprise_script_service/mruby/mrbgems/default.gembox +3 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrbgem.rake +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +47 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/src/array.c +3 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/test/array.rb +50 -29
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c +3 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apiprint.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdprint.c +3 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.h +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdbconf.h +4 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +28 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c +1 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/bintest/mruby.rb +75 -8
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +134 -90
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-class-ext/src/class.c +7 -8
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/codegen.c +69 -46
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/keywords +0 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/lex.def +51 -59
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/parse.y +430 -241
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/mrbgem.rake +10 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/mrblib/complex.rb +122 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/src/complex.c +249 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/test/complex.rb +153 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-chain/mrblib/chain.rb +19 -17
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-chain/test/enum_chain.rb +41 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-ext/mrblib/enum.rb +30 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-ext/test/enum.rb +8 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/mrbgem.rake +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/mrblib/enumerator.rb +46 -14
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/test/enumerator.rb +51 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-error/src/exception.c +10 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/src/eval.c +47 -44
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/test/eval.rb +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-exit/src/mruby-exit.c +9 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-fiber/src/fiber.c +16 -12
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-fiber/test/fiber.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/mrbgem.rake +0 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/mrblib/hash.rb +3 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/test/hash.rb +3 -7
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/README.md +1 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrbgem.rake +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/file.rb +0 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/io.rb +24 -38
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/kernel.rb +16 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file.c +19 -18
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file_test.c +5 -16
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/io.c +54 -42
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file.rb +24 -20
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file_test.rb +4 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/io.rb +41 -35
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/mruby_io_test.c +9 -36
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/mrbgem.rake +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/src/kernel.c +9 -27
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/test/kernel.rb +2 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-math/src/math.c +5 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/src/metaprog.c +39 -24
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/test/metaprog.rb +48 -17
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/mrblib/method.rb +0 -12
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/src/method.c +134 -101
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/test/method.rb +9 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb +1 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/src/numeric_ext.c +17 -37
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/test/numeric.rb +0 -8
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/mrbgem.rake +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/mrblib/object.rb +15 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/src/object.c +35 -6
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/test/nil.rb +4 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +1 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-objectspace/test/objectspace.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/src/pack.c +28 -23
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/test/pack.rb +43 -49
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-print/mrblib/print.rb +3 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/src/proc.c +6 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/test/proc.rb +21 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/random.c +157 -124
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/test/random.rb +72 -26
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/mrblib/range.rb +38 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/src/range.c +26 -11
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/test/range.rb +111 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/mrbgem.rake +5 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/mrblib/rational.rb +117 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/src/rational.c +209 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/test/rational.rb +308 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/README.md +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/src/socket.c +10 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/kernel.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/sprintf.c +22 -24
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/mrbgem.rake +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/mrblib/string.rb +8 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/src/string.c +116 -117
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/numeric.rb +29 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/range.rb +26 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/string.rb +32 -50
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/mrblib/struct.rb +5 -7
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/src/struct.c +43 -57
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/test/struct.rb +16 -11
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/driver.c +152 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/mrbgem.rake +4 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/vformat.c +200 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/include/mruby/time.h +2 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/src/time.c +199 -68
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/test/time.rb +81 -46
- data/ext/enterprise_script_service/mruby/mrblib/array.rb +14 -16
- data/ext/enterprise_script_service/mruby/mrblib/enum.rb +13 -9
- data/ext/enterprise_script_service/mruby/mrblib/hash.rb +5 -7
- data/ext/enterprise_script_service/mruby/mrblib/kernel.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrblib/numeric.rb +4 -4
- data/ext/enterprise_script_service/mruby/mrblib/range.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrblib/string.rb +55 -112
- data/ext/enterprise_script_service/mruby/mruby-source.gemspec +1 -1
- data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby.dict +105 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby_fuzzer.options +5 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby_proto_fuzzer.options +4 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/mruby_fuzzer.c +18 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/mruby_proto_fuzzer.cpp +44 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/proto_to_ruby.cpp +455 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/proto_to_ruby.h +55 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/ruby.proto +201 -0
- data/ext/enterprise_script_service/mruby/src/array.c +95 -46
- data/ext/enterprise_script_service/mruby/src/backtrace.c +6 -8
- data/ext/enterprise_script_service/mruby/src/class.c +370 -278
- data/ext/enterprise_script_service/mruby/src/codedump.c +34 -34
- data/ext/enterprise_script_service/mruby/src/debug.c +2 -2
- data/ext/enterprise_script_service/mruby/src/dump.c +8 -6
- data/ext/enterprise_script_service/mruby/src/enum.c +1 -1
- data/ext/enterprise_script_service/mruby/src/error.c +157 -55
- data/ext/enterprise_script_service/mruby/src/etc.c +13 -46
- data/ext/enterprise_script_service/mruby/src/fmt_fp.c +2 -2
- data/ext/enterprise_script_service/mruby/src/gc.c +30 -11
- data/ext/enterprise_script_service/mruby/src/hash.c +23 -14
- data/ext/enterprise_script_service/mruby/src/kernel.c +16 -54
- data/ext/enterprise_script_service/mruby/src/load.c +40 -76
- data/ext/enterprise_script_service/mruby/src/numeric.c +164 -94
- data/ext/enterprise_script_service/mruby/src/object.c +16 -39
- data/ext/enterprise_script_service/mruby/src/pool.c +0 -2
- data/ext/enterprise_script_service/mruby/src/proc.c +47 -48
- data/ext/enterprise_script_service/mruby/src/range.c +22 -35
- data/ext/enterprise_script_service/mruby/src/state.c +5 -94
- data/ext/enterprise_script_service/mruby/src/string.c +874 -710
- data/ext/enterprise_script_service/mruby/src/symbol.c +73 -48
- data/ext/enterprise_script_service/mruby/src/variable.c +58 -38
- data/ext/enterprise_script_service/mruby/src/vm.c +133 -304
- data/ext/enterprise_script_service/mruby/tasks/doc.rake +48 -0
- data/ext/enterprise_script_service/mruby/tasks/toolchains/clang.rake +3 -4
- data/ext/enterprise_script_service/mruby/tasks/toolchains/gcc.rake +20 -19
- data/ext/enterprise_script_service/mruby/tasks/toolchains/visualcpp.rake +0 -12
- data/ext/enterprise_script_service/mruby/test/assert.rb +186 -25
- data/ext/enterprise_script_service/mruby/test/t/array.rb +34 -6
- data/ext/enterprise_script_service/mruby/test/t/class.rb +26 -0
- data/ext/enterprise_script_service/mruby/test/t/enumerable.rb +2 -2
- data/ext/enterprise_script_service/mruby/test/t/float.rb +17 -17
- data/ext/enterprise_script_service/mruby/test/t/hash.rb +2 -0
- data/ext/enterprise_script_service/mruby/test/t/integer.rb +14 -6
- data/ext/enterprise_script_service/mruby/test/t/kernel.rb +38 -19
- data/ext/enterprise_script_service/mruby/test/t/module.rb +87 -14
- data/ext/enterprise_script_service/mruby/test/t/numeric.rb +65 -23
- data/ext/enterprise_script_service/mruby/test/t/range.rb +4 -4
- data/ext/enterprise_script_service/mruby/test/t/string.rb +211 -49
- data/ext/enterprise_script_service/mruby/test/t/syntax.rb +19 -2
- data/ext/enterprise_script_service/mruby/test/t/vformat.rb +92 -0
- data/ext/enterprise_script_service/mruby/travis_config.rb +2 -2
- data/ext/enterprise_script_service/mruby_config.rb +10 -0
- data/ext/enterprise_script_service/mruby_engine.cpp +2 -2
- data/ext/enterprise_script_service/mruby_engine.gembox +1 -0
- data/ext/enterprise_script_service/msgpack/CHANGELOG.md +14 -0
- data/ext/enterprise_script_service/msgpack/Files.cmake +4 -0
- data/ext/enterprise_script_service/msgpack/README.md +1 -1
- data/ext/enterprise_script_service/msgpack/appveyor.yml +1 -1
- data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_msgpack_tuple.hpp.erb +1 -1
- data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_msgpack_tuple_decl.hpp.erb +1 -1
- data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_zone.hpp.erb +3 -3
- data/ext/enterprise_script_service/msgpack/example/boost/asio_send_recv.cpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/adaptor/cpp11/timespec.hpp +16 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/adaptor/wstring.hpp +15 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/object.h +2 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/pack_template.h +17 -9
- data/ext/enterprise_script_service/msgpack/include/msgpack/sysdep.h +27 -16
- data/ext/enterprise_script_service/msgpack/include/msgpack/type.hpp +2 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/unpack_template.h +5 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/array_ref.hpp +0 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/check_container_size.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/cpp11/chrono.hpp +5 -5
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/cpp11/timespec.hpp +140 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp03_msgpack_tuple.hpp +32 -32
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp03_msgpack_tuple_decl.hpp +32 -32
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp11_msgpack_tuple.hpp +6 -6
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp11_msgpack_tuple_decl.hpp +10 -10
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/ext.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/fixint.hpp +5 -4
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/int.hpp +40 -13
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/int_decl.hpp +3 -2
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/wstring.hpp +121 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/detail/cpp03_zone.hpp +3 -3
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/detail/cpp11_zone.hpp +3 -3
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/object.hpp +6 -6
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/object_fwd.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/pack.hpp +40 -5
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/unpack.hpp +11 -11
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/vrefbuffer.hpp +7 -7
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/zbuffer.hpp +5 -5
- data/ext/enterprise_script_service/msgpack/include/msgpack/v2/adaptor/int_decl.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v2/create_object_visitor.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v2/parse.hpp +13 -13
- data/ext/enterprise_script_service/msgpack/include/msgpack/v2/x3_parse.hpp +28 -26
- data/ext/enterprise_script_service/msgpack/include/msgpack/v3/adaptor/int_decl.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v3/parse.hpp +13 -13
- data/ext/enterprise_script_service/msgpack/include/msgpack/version_master.h +2 -2
- data/ext/enterprise_script_service/msgpack/include/msgpack/zbuffer.h +6 -6
- data/ext/enterprise_script_service/msgpack/include/msgpack/zone.h +1 -1
- data/ext/enterprise_script_service/msgpack/src/objectc.c +83 -148
- data/ext/enterprise_script_service/msgpack/src/unpack.c +73 -47
- data/ext/enterprise_script_service/msgpack/test/CMakeLists.txt +1 -1
- data/ext/enterprise_script_service/msgpack/test/array_ref.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/boost_fusion.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/boost_optional.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/boost_string_ref.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/boost_string_view.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/boost_variant.cpp +15 -9
- data/ext/enterprise_script_service/msgpack/test/buffer.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/carray.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/cases.cpp +7 -1
- data/ext/enterprise_script_service/msgpack/test/convert.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/fixint.cpp +7 -1
- data/ext/enterprise_script_service/msgpack/test/fixint_c.cpp +6 -1
- data/ext/enterprise_script_service/msgpack/test/fuzz_unpack_pack_fuzzer_cpp11.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/iterator_cpp11.cpp +8 -2
- data/ext/enterprise_script_service/msgpack/test/json.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/limit.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_basic.cpp +128 -6
- data/ext/enterprise_script_service/msgpack/test/msgpack_c.cpp +7 -2
- data/ext/enterprise_script_service/msgpack/test/msgpack_container.cpp +20 -3
- data/ext/enterprise_script_service/msgpack/test/msgpack_cpp11.cpp +159 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_cpp17.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_stream.cpp +8 -3
- data/ext/enterprise_script_service/msgpack/test/msgpack_tuple.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_vref.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_x3_parse.cpp +23 -18
- data/ext/enterprise_script_service/msgpack/test/object.cpp +77 -45
- data/ext/enterprise_script_service/msgpack/test/object_with_zone.cpp +28 -10
- data/ext/enterprise_script_service/msgpack/test/pack_unpack.cpp +25 -18
- data/ext/enterprise_script_service/msgpack/test/pack_unpack_c.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/raw.cpp +17 -12
- data/ext/enterprise_script_service/msgpack/test/reference.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/reference_cpp11.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/reference_wrapper_cpp11.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/shared_ptr_cpp11.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/size_equal_only.cpp +6 -2
- data/ext/enterprise_script_service/msgpack/test/streaming.cpp +10 -3
- data/ext/enterprise_script_service/msgpack/test/streaming_c.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/unique_ptr_cpp11.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/user_class.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/version.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/visitor.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/zone.cpp +6 -0
- data/lib/script_core/version.rb +1 -1
- data/lib/tasks/mruby/engine.gembox.example +1 -0
- data/lib/tasks/script_core.rake +21 -3
- data/spec/dummy/app/helpers/fields_helper.rb +2 -2
- data/spec/dummy/mruby/engine.gembox +1 -0
- data/spec/script_core_spec.rb +1 -1
- metadata +38 -22
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/.gitignore +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/.travis.yml +0 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/run_test.rb +0 -26
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/mrblib/kernel.rb +0 -15
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/mrblib/unbound_method.rb +0 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/.gitignore +0 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/.travis.yml +0 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/packtest.rb +0 -157
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/run_test.rb +0 -26
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/mt19937ar.c +0 -224
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/mt19937ar.h +0 -80
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/random.h +0 -12
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.gitignore +0 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.travis.yml +0 -29
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.travis_build_config.rb +0 -6
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/Rakefile +0 -29
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/.travis.yml +0 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/run_test.rb +0 -28
@@ -356,6 +356,13 @@ def self.run_nil
|
|
356
356
|
end
|
357
357
|
end
|
358
358
|
end if Object.const_defined?(:Float)
|
359
|
+
|
360
|
+
o = Object.new
|
361
|
+
sc = class << o; self end
|
362
|
+
o.freeze
|
363
|
+
assert_predicate(sc, :frozen?)
|
364
|
+
|
365
|
+
assert_predicate(class << Object.new.freeze; self end, :frozen?)
|
359
366
|
end
|
360
367
|
|
361
368
|
assert('clone Class') do
|
@@ -433,6 +440,25 @@ class CVarOverrideTest
|
|
433
440
|
end
|
434
441
|
end
|
435
442
|
|
443
|
+
assert('class variable for frozen class/module') do
|
444
|
+
module CVarForFrozenModule
|
445
|
+
freeze
|
446
|
+
assert_raise(FrozenError) { @@cv = 1 }
|
447
|
+
end
|
448
|
+
|
449
|
+
class CVarForFrozenClassA
|
450
|
+
@@a = nil
|
451
|
+
freeze
|
452
|
+
end
|
453
|
+
class CVarForFrozenClassB < CVarForFrozenClassA
|
454
|
+
def a=(v)
|
455
|
+
@@a = v
|
456
|
+
end
|
457
|
+
end
|
458
|
+
b = CVarForFrozenClassB.new
|
459
|
+
assert_raise(FrozenError) { b.a = 1 }
|
460
|
+
end
|
461
|
+
|
436
462
|
assert('class with non-class/module outer raises TypeError') do
|
437
463
|
assert_raise(TypeError) { class 0::C1; end }
|
438
464
|
assert_raise(TypeError) { class []::C2; end }
|
@@ -45,7 +45,7 @@
|
|
45
45
|
|
46
46
|
assert('Enumerable#detect', '15.3.2.2.4') do
|
47
47
|
assert_equal 1, [1,2,3].detect() { true }
|
48
|
-
assert_equal 'a', [1,2,3].detect("a") { false }
|
48
|
+
assert_equal 'a', [1,2,3].detect(->{"a"}) { false }
|
49
49
|
end
|
50
50
|
|
51
51
|
assert('Array#each_with_index', '15.3.2.2.5') do
|
@@ -64,7 +64,7 @@
|
|
64
64
|
|
65
65
|
assert('Enumerable#find', '15.3.2.2.7') do
|
66
66
|
assert_equal 1, [1,2,3].find() { true }
|
67
|
-
assert_equal 'a', [1,2,3].find("a") { false }
|
67
|
+
assert_equal 'a', [1,2,3].find(->{"a"}) { false }
|
68
68
|
end
|
69
69
|
|
70
70
|
assert('Enumerable#find_all', '15.3.2.2.8') do
|
@@ -82,8 +82,8 @@
|
|
82
82
|
end
|
83
83
|
|
84
84
|
assert('Float#finite?', '15.2.9.3.9') do
|
85
|
-
|
86
|
-
|
85
|
+
assert_predicate 3.123456789, :finite?
|
86
|
+
assert_not_predicate 1.0 / 0.0, :finite?
|
87
87
|
end
|
88
88
|
|
89
89
|
assert('Float#floor', '15.2.9.3.10') do
|
@@ -139,7 +139,7 @@
|
|
139
139
|
nan = 0.0/0.0
|
140
140
|
assert_raise(FloatDomainError){ nan.round }
|
141
141
|
assert_raise(FloatDomainError){ nan.round(-1) }
|
142
|
-
|
142
|
+
assert_predicate(nan.round(1), :nan?)
|
143
143
|
end
|
144
144
|
|
145
145
|
assert('Float#to_f', '15.2.9.3.13') do
|
@@ -178,10 +178,10 @@ def check_floats exp, act
|
|
178
178
|
end
|
179
179
|
|
180
180
|
assert('Float#nan?') do
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
181
|
+
assert_predicate(0.0/0.0, :nan?)
|
182
|
+
assert_not_predicate(0.0, :nan?)
|
183
|
+
assert_not_predicate(1.0/0.0, :nan?)
|
184
|
+
assert_not_predicate(-1.0/0.0, :nan?)
|
185
185
|
end
|
186
186
|
|
187
187
|
assert('Float#<<') do
|
@@ -212,10 +212,10 @@ def check_floats exp, act
|
|
212
212
|
assert_equal("Infinity", Float::INFINITY.to_s)
|
213
213
|
assert_equal("-Infinity", (-Float::INFINITY).to_s)
|
214
214
|
assert_equal("NaN", Float::NAN.to_s)
|
215
|
-
assert_equal("0
|
216
|
-
assert_equal("-0
|
215
|
+
assert_equal("0", 0.0.to_s)
|
216
|
+
assert_equal("-0", -0.0.to_s)
|
217
217
|
assert_equal("-3.25", -3.25.to_s)
|
218
|
-
assert_equal("50
|
218
|
+
assert_equal("50", 50.0.to_s)
|
219
219
|
assert_equal("0.0125", 0.0125.to_s)
|
220
220
|
assert_equal("-0.0125", -0.0125.to_s)
|
221
221
|
assert_equal("1.0e-10", 0.0000000001.to_s)
|
@@ -224,8 +224,8 @@ def check_floats exp, act
|
|
224
224
|
assert_equal("-1.0e+20", -1e20.to_s)
|
225
225
|
assert_equal("1.0e+16", 10000000000000000.0.to_s)
|
226
226
|
assert_equal("-1.0e+16", -10000000000000000.0.to_s)
|
227
|
-
assert_equal("100000
|
228
|
-
assert_equal("-100000
|
227
|
+
assert_equal("100000", 100000.0.to_s)
|
228
|
+
assert_equal("-100000", -100000.0.to_s)
|
229
229
|
if uses_float
|
230
230
|
assert_equal("1.0e+08", 100000000.0.to_s)
|
231
231
|
assert_equal("-1.0e+08", -100000000.0.to_s)
|
@@ -234,15 +234,15 @@ def check_floats exp, act
|
|
234
234
|
else
|
235
235
|
assert_equal("1.0e+15", 1000000000000000.0.to_s)
|
236
236
|
assert_equal("-1.0e+15", -1000000000000000.0.to_s)
|
237
|
-
assert_equal("100000000000000
|
238
|
-
assert_equal("-100000000000000
|
237
|
+
assert_equal("100000000000000", 100000000000000.0.to_s)
|
238
|
+
assert_equal("-100000000000000", -100000000000000.0.to_s)
|
239
239
|
end
|
240
240
|
end
|
241
241
|
|
242
242
|
assert('Float#eql?') do
|
243
|
-
|
244
|
-
|
245
|
-
|
243
|
+
assert_operator(5.0, :eql?, 5.0)
|
244
|
+
assert_not_operator(5.0, :eql?, 5)
|
245
|
+
assert_not_operator(5.0, :eql?, "5.0")
|
246
246
|
end
|
247
247
|
|
248
248
|
end # const_defined?(:Float)
|
@@ -352,11 +352,13 @@ def hash.default(k); self[k] = 1; end
|
|
352
352
|
|
353
353
|
assert('Hash#inspect') do
|
354
354
|
h = { "c" => 300, "a" => 100, "d" => 400, "c" => 300 }
|
355
|
+
h["recur"] = h
|
355
356
|
ret = h.to_s
|
356
357
|
|
357
358
|
assert_include ret, '"c"=>300'
|
358
359
|
assert_include ret, '"a"=>100'
|
359
360
|
assert_include ret, '"d"=>400'
|
361
|
+
assert_include ret, '"recur"=>{...}'
|
360
362
|
end
|
361
363
|
|
362
364
|
assert('Hash#rehash') do
|
@@ -154,11 +154,11 @@
|
|
154
154
|
# Left Shift by a negative is Right Shift
|
155
155
|
assert_equal 23, 46 << -1
|
156
156
|
|
157
|
-
|
158
|
-
assert_equal 2147483648, 1 << 31
|
157
|
+
skip unless Object.const_defined?(:Float)
|
159
158
|
|
160
|
-
#
|
161
|
-
|
159
|
+
# Overflow to Fixnum
|
160
|
+
assert_float 9223372036854775808.0, 1 << 63
|
161
|
+
assert_float(-13835058055282163712.0, -3 << 62)
|
162
162
|
end
|
163
163
|
|
164
164
|
assert('Integer#>>', '15.2.8.3.13') do
|
@@ -232,8 +232,16 @@
|
|
232
232
|
end
|
233
233
|
|
234
234
|
assert('Integer#to_s', '15.2.8.3.25') do
|
235
|
-
assert_equal
|
236
|
-
assert_equal
|
235
|
+
assert_equal "1", 1.to_s
|
236
|
+
assert_equal "-1", -1.to_s
|
237
|
+
assert_equal "1010", 10.to_s(2)
|
238
|
+
assert_equal "a", 10.to_s(36)
|
239
|
+
assert_equal "-a", -10.to_s(36)
|
240
|
+
assert_equal "30071", 12345.to_s(8)
|
241
|
+
assert_raise(ArgumentError) { 10.to_s(-1) }
|
242
|
+
assert_raise(ArgumentError) { 10.to_s(0) }
|
243
|
+
assert_raise(ArgumentError) { 10.to_s(1) }
|
244
|
+
assert_raise(ArgumentError) { 10.to_s(37) }
|
237
245
|
end
|
238
246
|
|
239
247
|
assert('Integer#truncate', '15.2.8.3.26') do
|
@@ -31,10 +31,6 @@ def bg_try(&b)
|
|
31
31
|
|
32
32
|
# Kernel.eval is provided by the mruby-gem mrbgem. '15.3.1.2.3'
|
33
33
|
|
34
|
-
assert('Kernel.global_variables', '15.3.1.2.4') do
|
35
|
-
assert_equal Array, Kernel.global_variables.class
|
36
|
-
end
|
37
|
-
|
38
34
|
assert('Kernel.iterator?', '15.3.1.2.5') do
|
39
35
|
assert_false Kernel.iterator?
|
40
36
|
end
|
@@ -92,6 +88,20 @@ def bg_try(&b)
|
|
92
88
|
assert_equal Fixnum, __id__.class
|
93
89
|
end
|
94
90
|
|
91
|
+
assert('Kernel#__send__', '15.3.1.3.4') do
|
92
|
+
# test with block
|
93
|
+
l = __send__(:lambda) do
|
94
|
+
true
|
95
|
+
end
|
96
|
+
|
97
|
+
assert_true l.call
|
98
|
+
assert_equal Proc, l.class
|
99
|
+
# test with argument
|
100
|
+
assert_true __send__(:respond_to?, :nil?)
|
101
|
+
# test without argument and without block
|
102
|
+
assert_equal String, __send__(:to_s).class
|
103
|
+
end
|
104
|
+
|
95
105
|
assert('Kernel#block_given?', '15.3.1.3.6') do
|
96
106
|
def bg_try(&b)
|
97
107
|
if block_given?
|
@@ -230,6 +240,9 @@ def test_method; end
|
|
230
240
|
|
231
241
|
assert_true a.respond_to?(:test_method)
|
232
242
|
assert_false b.respond_to?(:test_method)
|
243
|
+
|
244
|
+
assert_raise(FrozenError) { Object.new.freeze.extend(Test4ExtendModule) }
|
245
|
+
assert_raise(FrozenError, TypeError) { :sym.extend(Test4ExtendModule) }
|
233
246
|
end
|
234
247
|
|
235
248
|
assert('Kernel#extend works on toplevel', '15.3.1.3.13') do
|
@@ -247,10 +260,23 @@ def test_method; end
|
|
247
260
|
assert_equal obj, obj.freeze
|
248
261
|
assert_equal 0, 0.freeze
|
249
262
|
assert_equal :a, :a.freeze
|
263
|
+
assert_equal true, true.freeze
|
264
|
+
assert_equal false, false.freeze
|
265
|
+
assert_equal nil, nil.freeze
|
266
|
+
skip unless Object.const_defined?(:Float)
|
267
|
+
assert_equal 0.0, 0.0.freeze
|
250
268
|
end
|
251
269
|
|
252
|
-
assert('Kernel#
|
253
|
-
|
270
|
+
assert('Kernel#frozen?') do
|
271
|
+
assert_false "".frozen?
|
272
|
+
assert_true "".freeze.frozen?
|
273
|
+
assert_true 0.frozen?
|
274
|
+
assert_true :a.frozen?
|
275
|
+
assert_true true.frozen?
|
276
|
+
assert_true false.frozen?
|
277
|
+
assert_true nil.frozen?
|
278
|
+
skip unless Object.const_defined?(:Float)
|
279
|
+
assert_true 0.0.frozen?
|
254
280
|
end
|
255
281
|
|
256
282
|
assert('Kernel#hash', '15.3.1.3.15') do
|
@@ -329,17 +355,15 @@ def no_super_method_named_this
|
|
329
355
|
end
|
330
356
|
end
|
331
357
|
no_super_test = NoSuperMethodTestClass.new
|
332
|
-
|
358
|
+
msg = "undefined method 'no_super_method_named_this'"
|
359
|
+
assert_raise_with_message(NoMethodError, msg) do
|
333
360
|
no_super_test.no_super_method_named_this
|
334
|
-
rescue NoMethodError => e
|
335
|
-
assert_equal "undefined method 'no_super_method_named_this'", e.message
|
336
361
|
end
|
337
362
|
|
338
363
|
a = String.new
|
339
|
-
|
364
|
+
msg = "undefined method 'no_method_named_this'"
|
365
|
+
assert_raise_with_message(NoMethodError, msg) do
|
340
366
|
a.no_method_named_this
|
341
|
-
rescue NoMethodError => e
|
342
|
-
assert_equal "undefined method 'no_method_named_this'", e.message
|
343
367
|
end
|
344
368
|
end
|
345
369
|
|
@@ -395,6 +419,8 @@ def remove
|
|
395
419
|
assert_equal nil, tri.var
|
396
420
|
assert_raise(NameError) { tri.remove }
|
397
421
|
assert_raise(NameError) { tri.remove_instance_variable(:var) }
|
422
|
+
assert_raise(FrozenError) { tri.freeze.remove }
|
423
|
+
assert_raise(FrozenError, NameError) { :a.remove_instance_variable(:@v) }
|
398
424
|
end
|
399
425
|
|
400
426
|
# Kernel#require is defined in mruby-require. '15.3.1.3.42'
|
@@ -471,13 +497,6 @@ def respond_to_missing?(method_name, include_private = false)
|
|
471
497
|
assert_false Test4RespondToMissing.new.respond_to?(:no_method)
|
472
498
|
end
|
473
499
|
|
474
|
-
assert('Kernel#global_variables') do
|
475
|
-
variables = global_variables
|
476
|
-
1.upto(9) do |i|
|
477
|
-
assert_equal variables.include?(:"$#{i}"), true
|
478
|
-
end
|
479
|
-
end
|
480
|
-
|
481
500
|
assert('stack extend') do
|
482
501
|
def recurse(count, stop)
|
483
502
|
return count if count > stop
|
@@ -21,10 +21,29 @@ def labeled_class(name, supklass = Object, &block)
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
+
def assert_uninitialized_const(&block)
|
25
|
+
assert_raise_with_message_pattern(NameError, "uninitialized constant *", &block)
|
26
|
+
end
|
27
|
+
|
28
|
+
def assert_wrong_const_name(&block)
|
29
|
+
assert_raise_with_message_pattern(NameError, "wrong constant name *", &block)
|
30
|
+
end
|
31
|
+
|
24
32
|
assert('Module', '15.2.2') do
|
25
33
|
assert_equal Class, Module.class
|
26
34
|
end
|
27
35
|
|
36
|
+
assert('Module#alias_method', '15.2.2.4.8') do
|
37
|
+
cls = Class.new do
|
38
|
+
def foo
|
39
|
+
"FOO"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
assert_same(cls, cls.alias_method(:bar, :foo))
|
44
|
+
assert_equal("FOO", cls.new.bar)
|
45
|
+
end
|
46
|
+
|
28
47
|
# TODO not implemented ATM assert('Module.constants', '15.2.2.3.1') do
|
29
48
|
|
30
49
|
assert('Module#ancestors', '15.2.2.4.9') do
|
@@ -48,6 +67,7 @@ module Test4AppendFeatures2
|
|
48
67
|
end
|
49
68
|
|
50
69
|
assert_equal Test4AppendFeatures2, Test4AppendFeatures2.const_get(:Const4AppendFeatures2)
|
70
|
+
assert_raise(FrozenError) { Module.new.append_features Class.new.freeze }
|
51
71
|
end
|
52
72
|
|
53
73
|
assert('Module#attr NameError') do
|
@@ -210,7 +230,7 @@ module Test4ConstDefined
|
|
210
230
|
|
211
231
|
assert_true Test4ConstDefined.const_defined?(:Const4Test4ConstDefined)
|
212
232
|
assert_false Test4ConstDefined.const_defined?(:NotExisting)
|
213
|
-
|
233
|
+
assert_wrong_const_name{ Test4ConstDefined.const_defined?(:wrong_name) }
|
214
234
|
end
|
215
235
|
|
216
236
|
assert('Module#const_get', '15.2.2.4.21') do
|
@@ -223,9 +243,9 @@ module Test4ConstGet
|
|
223
243
|
assert_equal 42, Object.const_get("Test4ConstGet::Const4Test4ConstGet")
|
224
244
|
|
225
245
|
assert_raise(TypeError){ Test4ConstGet.const_get(123) }
|
226
|
-
|
227
|
-
|
228
|
-
|
246
|
+
assert_uninitialized_const{ Test4ConstGet.const_get(:I_DO_NOT_EXIST) }
|
247
|
+
assert_uninitialized_const{ Test4ConstGet.const_get("I_DO_NOT_EXIST::ME_NEITHER") }
|
248
|
+
assert_wrong_const_name{ Test4ConstGet.const_get(:wrong_name) }
|
229
249
|
end
|
230
250
|
|
231
251
|
assert('Module#const_set', '15.2.2.4.23') do
|
@@ -236,7 +256,7 @@ module Test4ConstSet
|
|
236
256
|
assert_equal 23, Test4ConstSet.const_set(:Const4Test4ConstSet, 23)
|
237
257
|
assert_equal 23, Test4ConstSet.const_get(:Const4Test4ConstSet)
|
238
258
|
["", "wrongNAME", "Wrong-Name"].each do |n|
|
239
|
-
|
259
|
+
assert_wrong_const_name { Test4ConstSet.const_set(n, 1) }
|
240
260
|
end
|
241
261
|
end
|
242
262
|
|
@@ -247,10 +267,13 @@ module Test4RemoveConst
|
|
247
267
|
|
248
268
|
assert_equal 23, Test4RemoveConst.remove_const(:ExistingConst)
|
249
269
|
assert_false Test4RemoveConst.const_defined?(:ExistingConst)
|
250
|
-
|
270
|
+
assert_raise_with_message_pattern(NameError, "constant * not defined") do
|
271
|
+
Test4RemoveConst.remove_const(:NonExistingConst)
|
272
|
+
end
|
251
273
|
%i[x X!].each do |n|
|
252
|
-
|
274
|
+
assert_wrong_const_name { Test4RemoveConst.remove_const(n) }
|
253
275
|
end
|
276
|
+
assert_raise(FrozenError) { Test4RemoveConst.freeze.remove_const(:A) }
|
254
277
|
end
|
255
278
|
|
256
279
|
assert('Module#const_missing', '15.2.2.4.22') do
|
@@ -263,6 +286,18 @@ def self.const_missing(sym)
|
|
263
286
|
assert_equal 42, Test4ConstMissing.const_get(:ConstDoesntExist)
|
264
287
|
end
|
265
288
|
|
289
|
+
assert('Module#extend_object', '15.2.2.4.25') do
|
290
|
+
cls = Class.new
|
291
|
+
mod = Module.new { def foo; end }
|
292
|
+
a = cls.new
|
293
|
+
b = cls.new
|
294
|
+
mod.extend_object(b)
|
295
|
+
assert_false a.respond_to?(:foo)
|
296
|
+
assert_true b.respond_to?(:foo)
|
297
|
+
assert_raise(FrozenError) { mod.extend_object(cls.new.freeze) }
|
298
|
+
assert_raise(FrozenError, TypeError) { mod.extend_object(1) }
|
299
|
+
end
|
300
|
+
|
266
301
|
assert('Module#include', '15.2.2.4.27') do
|
267
302
|
module Test4Include
|
268
303
|
Const4Include = 42
|
@@ -276,6 +311,7 @@ class << self
|
|
276
311
|
|
277
312
|
assert_equal 42, Test4Include2.const_get(:Const4Include)
|
278
313
|
assert_equal Test4Include2, Test4Include2.include_result
|
314
|
+
assert_raise(FrozenError) { Module.new.freeze.include Test4Include }
|
279
315
|
end
|
280
316
|
|
281
317
|
assert('Module#include?', '15.2.2.4.28') do
|
@@ -374,6 +410,29 @@ class GrandChild < Child
|
|
374
410
|
|
375
411
|
# Not ISO specified
|
376
412
|
|
413
|
+
assert('Module#dup') do
|
414
|
+
module TestModuleDup
|
415
|
+
@@cvar = :cvar
|
416
|
+
class << self
|
417
|
+
attr_accessor :cattr
|
418
|
+
def cmeth; :cmeth end
|
419
|
+
end
|
420
|
+
def cvar; @@cvar end
|
421
|
+
def imeth; :imeth end
|
422
|
+
self.cattr = :cattr
|
423
|
+
end
|
424
|
+
|
425
|
+
m = TestModuleDup.dup
|
426
|
+
o = Object.include(m).new
|
427
|
+
assert_equal(:cattr, m.cattr)
|
428
|
+
assert_equal(:cmeth, m.cmeth)
|
429
|
+
assert_equal(:cvar, o.cvar)
|
430
|
+
assert_equal(:imeth, o.imeth)
|
431
|
+
assert_match("#<Module:0x*>", m.to_s)
|
432
|
+
assert_not_predicate(m, :frozen?)
|
433
|
+
assert_not_predicate(TestModuleDup.freeze.dup, :frozen?)
|
434
|
+
end
|
435
|
+
|
377
436
|
assert('Module#define_method') do
|
378
437
|
c = Class.new {
|
379
438
|
define_method(:m1) { :ok }
|
@@ -386,6 +445,15 @@ class GrandChild < Child
|
|
386
445
|
end
|
387
446
|
end
|
388
447
|
|
448
|
+
assert 'Module#prepend_features' do
|
449
|
+
mod = Module.new { def m; :mod end }
|
450
|
+
cls = Class.new { def m; :cls end }
|
451
|
+
assert_equal :cls, cls.new.m
|
452
|
+
mod.prepend_features(cls)
|
453
|
+
assert_equal :mod, cls.new.m
|
454
|
+
assert_raise(FrozenError) { Module.new.prepend_features(Class.new.freeze) }
|
455
|
+
end
|
456
|
+
|
389
457
|
# @!group prepend
|
390
458
|
assert('Module#prepend') do
|
391
459
|
module M0
|
@@ -620,6 +688,10 @@ class << self
|
|
620
688
|
# end
|
621
689
|
# end;
|
622
690
|
#end
|
691
|
+
|
692
|
+
assert 'Module#prepend to frozen class' do
|
693
|
+
assert_raise(FrozenError) { Class.new.freeze.prepend Module.new }
|
694
|
+
end
|
623
695
|
# @!endgroup prepend
|
624
696
|
|
625
697
|
assert('Module#to_s') do
|
@@ -640,11 +712,12 @@ class Inner; end
|
|
640
712
|
assert_equal 'SetOuter', SetOuter.to_s
|
641
713
|
assert_equal 'SetOuter::SetInner', SetOuter::SetInner.to_s
|
642
714
|
|
643
|
-
|
644
|
-
|
715
|
+
assert_match "#<Module:0x*>", Module.new.to_s
|
716
|
+
assert_match "#<Class:0x*>", Class.new.to_s
|
645
717
|
|
646
|
-
assert_equal "
|
647
|
-
assert_equal "
|
718
|
+
assert_equal "FrozenClassToS", (FrozenClassToS = Class.new.freeze).to_s
|
719
|
+
assert_equal "Outer::A", (Outer::A = Module.new.freeze).to_s
|
720
|
+
assert_match "#<Module:0x*>::A", (Module.new::A = Class.new.freeze).to_s
|
648
721
|
end
|
649
722
|
|
650
723
|
assert('Module#inspect') do
|
@@ -672,8 +745,8 @@ class C2
|
|
672
745
|
include M1
|
673
746
|
end
|
674
747
|
|
675
|
-
C1.new
|
676
|
-
C2.new
|
748
|
+
assert_kind_of(M1, C1.new)
|
749
|
+
assert_kind_of(M1, C2.new)
|
677
750
|
end
|
678
751
|
|
679
752
|
assert('clone Module') do
|
@@ -687,7 +760,7 @@ class B
|
|
687
760
|
include M1.clone
|
688
761
|
end
|
689
762
|
|
690
|
-
B.new.foo
|
763
|
+
assert_true(B.new.foo)
|
691
764
|
end
|
692
765
|
|
693
766
|
assert('Module#module_function') do
|