summaryrefslogtreecommitdiffhomepage
path: root/mrbgems
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2014-04-30 09:50:14 +0900
committerNobuyoshi Nakada <[email protected]>2014-04-30 09:50:14 +0900
commitab67c57f652c7c3a64ec4f4dc73259a14fb1b545 (patch)
treed9535d70ba74920783864fa6372ec471aca5af91 /mrbgems
parent345f172bba2dc5a6df607dded5c4b95b0e68f9bf (diff)
downloadmruby-ab67c57f652c7c3a64ec4f4dc73259a14fb1b545.tar.gz
mruby-ab67c57f652c7c3a64ec4f4dc73259a14fb1b545.zip
remove trailing spaces
Diffstat (limited to 'mrbgems')
-rw-r--r--mrbgems/mruby-array-ext/mrblib/array.rb4
-rw-r--r--mrbgems/mruby-array-ext/test/array.rb12
-rw-r--r--mrbgems/mruby-bin-mirb/tools/mirb/mirb.c4
-rw-r--r--mrbgems/mruby-bin-mruby-config/mruby-config2
-rw-r--r--mrbgems/mruby-bin-mruby/tools/mruby/mruby.c2
-rw-r--r--mrbgems/mruby-enum-ext/mrblib/enum.rb6
-rw-r--r--mrbgems/mruby-enum-ext/test/enum.rb2
-rw-r--r--mrbgems/mruby-enum-lazy/mrblib/lazy.rb2
-rw-r--r--mrbgems/mruby-enumerator/test/enumerator.rb2
-rw-r--r--mrbgems/mruby-fiber/src/fiber.c10
-rw-r--r--mrbgems/mruby-hash-ext/test/hash.rb2
-rw-r--r--mrbgems/mruby-random/src/mt19937ar.c42
-rw-r--r--mrbgems/mruby-random/src/random.c64
-rw-r--r--mrbgems/mruby-random/test/random.rb16
-rw-r--r--mrbgems/mruby-string-ext/test/string.rb8
-rw-r--r--mrbgems/mruby-string-utf8/test/string.rb4
-rw-r--r--mrbgems/mruby-toplevel-ext/test/toplevel.rb2
17 files changed, 92 insertions, 92 deletions
diff --git a/mrbgems/mruby-array-ext/mrblib/array.rb b/mrbgems/mruby-array-ext/mrblib/array.rb
index 3a4b1460b..df3ab97e4 100644
--- a/mrbgems/mruby-array-ext/mrblib/array.rb
+++ b/mrbgems/mruby-array-ext/mrblib/array.rb
@@ -58,7 +58,7 @@ class Array
ary = self.dup
if block
ary.uniq!(&block)
- else
+ else
ary.uniq!
end
ary
@@ -370,7 +370,7 @@ class Array
self[i] = block.call(i)
i += 1
end
- else
+ else
while i < len
self[i] = arg0
i += 1
diff --git a/mrbgems/mruby-array-ext/test/array.rb b/mrbgems/mruby-array-ext/test/array.rb
index f94189356..b0ad94b38 100644
--- a/mrbgems/mruby-array-ext/test/array.rb
+++ b/mrbgems/mruby-array-ext/test/array.rb
@@ -19,7 +19,7 @@ end
assert("Array#at") do
a = [ "a", "b", "c", "d", "e" ]
assert_equal "a", a.at(0)
- assert_equal "e", a.at(-1)
+ assert_equal "e", a.at(-1)
end
assert("Array#rassoc") do
@@ -50,7 +50,7 @@ assert("Array#uniq") do
assert_equal [1, 2, 3, 1], a
b = [["student","sam"], ["student","george"], ["teacher","matz"]]
- assert_equal [["student", "sam"], ["teacher", "matz"]], b.uniq { |s| s.first }
+ assert_equal [["student", "sam"], ["teacher", "matz"]], b.uniq { |s| s.first }
end
assert("Array#-") do
@@ -60,7 +60,7 @@ assert("Array#-") do
assert_raise(TypeError) { a - c }
assert_equal [2, 3], (a - b)
- assert_equal [1, 2, 3, 1], a
+ assert_equal [1, 2, 3, 1], a
end
assert("Array#|") do
@@ -70,7 +70,7 @@ assert("Array#|") do
assert_raise(TypeError) { a | c }
assert_equal [1, 2, 3, 4], (a | b)
- assert_equal [1, 2, 3, 1], a
+ assert_equal [1, 2, 3, 1], a
end
assert("Array#&") do
@@ -79,8 +79,8 @@ assert("Array#&") do
c = 1
assert_raise(TypeError) { a & c }
- assert_equal [1], (a & b)
- assert_equal [1, 2, 3, 1], a
+ assert_equal [1], (a & b)
+ assert_equal [1, 2, 3, 1], a
end
assert("Array#flatten") do
diff --git a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
index 320bc30fb..62f9e62fe 100644
--- a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
+++ b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c
@@ -31,7 +31,7 @@
#define MIRB_READ_HISTORY(path) linenoiseHistoryLoad(history_path)
#define MIRB_USING_HISTORY()
#endif
-
+
#ifdef ENABLE_READLINE
#include <limits.h>
static const char *history_file_name = ".mirb_history";
@@ -244,7 +244,7 @@ print_cmdline(int code_block_open)
printf("> ");
}
}
-#endif
+#endif
void mrb_codedump_all(mrb_state*, struct RProc*);
diff --git a/mrbgems/mruby-bin-mruby-config/mruby-config b/mrbgems/mruby-bin-mruby-config/mruby-config
index 20b1701a7..f346eb719 100644
--- a/mrbgems/mruby-bin-mruby-config/mruby-config
+++ b/mrbgems/mruby-bin-mruby-config/mruby-config
@@ -9,7 +9,7 @@ while [ $# -gt 0 ]; do
echo " switches:"
echo " --cflags print flags passed to compiler"
echo " --ldflags print flags passed to linker"
- echo " --libs print linked libraries"
+ echo " --libs print linked libraries"
exit 0;;
esac
shift
diff --git a/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c b/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c
index f60fd1974..73617b162 100644
--- a/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c
+++ b/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c
@@ -211,7 +211,7 @@ main(int argc, char **argv)
cmdline = args.cmdline ? args.cmdline : "-";
mrbc_filename(mrb, c, cmdline);
mrb_gv_set(mrb, zero_sym, mrb_str_new_cstr(mrb, cmdline));
- }
+ }
else {
mrbc_filename(mrb, c, "-e");
mrb_gv_set(mrb, zero_sym, mrb_str_new_lit(mrb, "-e"));
diff --git a/mrbgems/mruby-enum-ext/mrblib/enum.rb b/mrbgems/mruby-enum-ext/mrblib/enum.rb
index 22c793108..5abb75d54 100644
--- a/mrbgems/mruby-enum-ext/mrblib/enum.rb
+++ b/mrbgems/mruby-enum-ext/mrblib/enum.rb
@@ -92,7 +92,7 @@ module Enumerable
end
ary
end
-
+
##
# call-seq:
# enum.each_cons(n) {...} -> nil
@@ -192,7 +192,7 @@ module Enumerable
return to_enum :sort_by unless block_given?
ary = []
- orig = []
+ orig = []
self.each_with_index{|e, i|
orig.push(e)
ary.push([block.call(e), i])
@@ -253,7 +253,7 @@ module Enumerable
self.each { count += 1 }
else
self.each do |*val|
- count += 1 if val.__svalue == v
+ count += 1 if val.__svalue == v
end
end
end
diff --git a/mrbgems/mruby-enum-ext/test/enum.rb b/mrbgems/mruby-enum-ext/test/enum.rb
index 9348cb4a5..bce9cb15d 100644
--- a/mrbgems/mruby-enum-ext/test/enum.rb
+++ b/mrbgems/mruby-enum-ext/test/enum.rb
@@ -108,7 +108,7 @@ assert("Enumerable#one?") do
assert_false %w(ant bear cat).one? { |word| word.length > 4 }
assert_false %w(ant bear cat).one? { |word| word.length < 4 }
assert_false [nil, true, 99].one?
- assert_true [nil, true, false].one?
+ assert_true [nil, true, false].one?
end
assert("Enumerable#each_with_object") do
diff --git a/mrbgems/mruby-enum-lazy/mrblib/lazy.rb b/mrbgems/mruby-enum-lazy/mrblib/lazy.rb
index 088ce760d..2ffeb1808 100644
--- a/mrbgems/mruby-enum-lazy/mrblib/lazy.rb
+++ b/mrbgems/mruby-enum-lazy/mrblib/lazy.rb
@@ -97,7 +97,7 @@ module Enumerable
end
}
end
-
+
def take(n)
if n == 0
return Lazy.new(self){raise StopIteration}
diff --git a/mrbgems/mruby-enumerator/test/enumerator.rb b/mrbgems/mruby-enumerator/test/enumerator.rb
index b22ed7754..0e3ddcba9 100644
--- a/mrbgems/mruby-enumerator/test/enumerator.rb
+++ b/mrbgems/mruby-enumerator/test/enumerator.rb
@@ -78,7 +78,7 @@ assert 'Enumerator#with_object arguments' do
y << x
end
end
-
+
a = []
to_three_with_string = to_three.with_object("foo")
to_three_with_string.each do |x,string|
diff --git a/mrbgems/mruby-fiber/src/fiber.c b/mrbgems/mruby-fiber/src/fiber.c
index 927cccac7..9bd15f4b6 100644
--- a/mrbgems/mruby-fiber/src/fiber.c
+++ b/mrbgems/mruby-fiber/src/fiber.c
@@ -13,7 +13,7 @@
* Fiber.new{...} -> obj
*
* Creates a fiber, whose execution is suspend until it is explicitly
- * resumed using <code>Fiber#resume</code> method.
+ * resumed using <code>Fiber#resume</code> method.
* The code running inside the fiber can give up control by calling
* <code>Fiber.yield</code> in which case it yields control back to caller
* (the caller of the <code>Fiber#resume</code>).
@@ -71,7 +71,7 @@ fiber_init(mrb_state *mrb, mrb_value self)
mrb_value blk;
mrb_get_args(mrb, "&", &blk);
-
+
if (mrb_nil_p(blk)) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "tried to create Fiber object without a block");
}
@@ -166,7 +166,7 @@ fiber_switch(mrb_state *mrb, mrb_value self, mrb_int len, const mrb_value *a, mr
*b++ = *a++;
}
c->cibase->argc = len;
- if (c->prev->fib)
+ if (c->prev->fib)
mrb_field_write_barrier(mrb, (struct RBasic*)c->fib, (struct RBasic*)c->prev->fib);
mrb_write_barrier(mrb, (struct RBasic*)c->fib);
c->status = MRB_FIBER_RUNNING;
@@ -176,7 +176,7 @@ fiber_switch(mrb_state *mrb, mrb_value self, mrb_int len, const mrb_value *a, mr
return c->ci->proc->env->stack[0];
}
MARK_CONTEXT_MODIFY(c);
- if (c->prev->fib)
+ if (c->prev->fib)
mrb_field_write_barrier(mrb, (struct RBasic*)c->fib, (struct RBasic*)c->prev->fib);
mrb_write_barrier(mrb, (struct RBasic*)c->fib);
c->status = MRB_FIBER_RUNNING;
@@ -332,7 +332,7 @@ fiber_current(mrb_state *mrb, mrb_value self)
}
return mrb_obj_value(mrb->c->fib);
}
-
+
void
mrb_mruby_fiber_gem_init(mrb_state* mrb)
{
diff --git a/mrbgems/mruby-hash-ext/test/hash.rb b/mrbgems/mruby-hash-ext/test/hash.rb
index 661da3af3..83a064811 100644
--- a/mrbgems/mruby-hash-ext/test/hash.rb
+++ b/mrbgems/mruby-hash-ext/test/hash.rb
@@ -6,7 +6,7 @@ assert('Hash#merge!') do
b = { 'cba_key' => 'XXX', 'xyz_key' => 'xyz_value' }
result_1 = a.merge! b
-
+
a = { 'abc_key' => 'abc_value', 'cba_key' => 'cba_value' }
result_2 = a.merge!(b) do |key, original, new|
original
diff --git a/mrbgems/mruby-random/src/mt19937ar.c b/mrbgems/mruby-random/src/mt19937ar.c
index a27aee311..0e1279b34 100644
--- a/mrbgems/mruby-random/src/mt19937ar.c
+++ b/mrbgems/mruby-random/src/mt19937ar.c
@@ -7,8 +7,8 @@
#include "mruby.h"
#include "mt19937ar.h"
-/* Period parameters */
-/* #define N 624 */
+/* Period parameters */
+/* #define N 624 */
#define M 397
#define MATRIX_A 0x9908b0dfUL /* constant vector a */
#define UPPER_MASK 0x80000000UL /* most significant w-r bits */
@@ -23,8 +23,8 @@ void mrb_random_init_genrand(mt_state *t, unsigned long s)
{
t->mt[0]= s & 0xffffffffUL;
for (t->mti=1; t->mti<N; t->mti++) {
- t->mt[t->mti] =
- (1812433253UL * (t->mt[t->mti-1] ^ (t->mt[t->mti-1] >> 30)) + t->mti);
+ t->mt[t->mti] =
+ (1812433253UL * (t->mt[t->mti-1] ^ (t->mt[t->mti-1] >> 30)) + t->mti);
t->mt[t->mti] &= 0xffffffffUL;
}
}
@@ -54,7 +54,7 @@ unsigned long mrb_random_genrand_int32(mt_state *t)
t->mti = 0;
}
-
+
y = t->mt[t->mti++];
/* Tempering */
@@ -62,7 +62,7 @@ unsigned long mrb_random_genrand_int32(mt_state *t)
y ^= (y << 7) & 0x9d2c5680UL;
y ^= (y << 15) & 0xefc60000UL;
y ^= (y >> 18);
-
+
t->gen.int_ = y;
return y;
@@ -71,9 +71,9 @@ unsigned long mrb_random_genrand_int32(mt_state *t)
double mrb_random_genrand_real1(mt_state *t)
{
mrb_random_genrand_int32(t);
- t->gen.double_ = t->gen.int_*(1.0/4294967295.0);
+ t->gen.double_ = t->gen.int_*(1.0/4294967295.0);
return t->gen.double_;
- /* divided by 2^32-1 */
+ /* divided by 2^32-1 */
}
#if 0 /* dead_code */
@@ -82,8 +82,8 @@ void init_genrand(unsigned long s)
{
mt[0]= s & 0xffffffffUL;
for (mti=1; mti<N; mti++) {
- mt[mti] =
- (1812433253UL * (mt[mti-1] ^ (mt[mti-1] >> 30)) + mti);
+ mt[mti] =
+ (1812433253UL * (mt[mti-1] ^ (mt[mti-1] >> 30)) + mti);
/* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
/* In the previous versions, MSBs of the seed affect */
/* only MSBs of the array mt[]. */
@@ -119,7 +119,7 @@ void init_by_array(unsigned long init_key[], int key_length)
if (i>=N) { mt[0] = mt[N-1]; i=1; }
}
- mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */
+ mt[0] = 0x80000000UL; /* MSB is 1; assuring non-zero initial array */
}
/* generates a random number on [0,0xffffffff]-interval */
@@ -148,7 +148,7 @@ unsigned long genrand_int32(void)
mti = 0;
}
-
+
y = mt[mti++];
/* Tempering */
@@ -169,29 +169,29 @@ long genrand_int31(void)
/* generates a random number on [0,1]-real-interval */
double genrand_real1(void)
{
- return genrand_int32()*(1.0/4294967295.0);
- /* divided by 2^32-1 */
+ return genrand_int32()*(1.0/4294967295.0);
+ /* divided by 2^32-1 */
}
/* generates a random number on [0,1)-real-interval */
double genrand_real2(void)
{
- return genrand_int32()*(1.0/4294967296.0);
+ return genrand_int32()*(1.0/4294967296.0);
/* divided by 2^32 */
}
/* generates a random number on (0,1)-real-interval */
double genrand_real3(void)
{
- return (((double)genrand_int32()) + 0.5)*(1.0/4294967296.0);
+ return (((double)genrand_int32()) + 0.5)*(1.0/4294967296.0);
/* divided by 2^32 */
}
/* generates a random number on [0,1) with 53-bit resolution*/
-double genrand_res53(void)
-{
- unsigned long a=genrand_int32()>>5, b=genrand_int32()>>6;
- return(a*67108864.0+b)*(1.0/9007199254740992.0);
-}
+double genrand_res53(void)
+{
+ unsigned long a=genrand_int32()>>5, b=genrand_int32()>>6;
+ return(a*67108864.0+b)*(1.0/9007199254740992.0);
+}
/* These real versions are due to Isaku Wada, 2002/01/09 added */
#endif /* dead_code */
diff --git a/mrbgems/mruby-random/src/random.c b/mrbgems/mruby-random/src/random.c
index 8f983ea0f..7756bc7c9 100644
--- a/mrbgems/mruby-random/src/random.c
+++ b/mrbgems/mruby-random/src/random.c
@@ -22,27 +22,27 @@ static const struct mrb_data_type mt_state_type = {
static mrb_value mrb_random_rand(mrb_state *mrb, mrb_value self);
static mrb_value mrb_random_srand(mrb_state *mrb, mrb_value self);
-static void
+static void
mt_srand(mt_state *t, unsigned long seed)
{
mrb_random_init_genrand(t, seed);
-}
+}
-static unsigned long
+static unsigned long
mt_rand(mt_state *t)
{
return mrb_random_genrand_int32(t);
-}
+}
-static double
+static double
mt_rand_real(mt_state *t)
{
return mrb_random_genrand_real1(t);
-}
+}
-static mrb_value
+static mrb_value
mrb_random_mt_srand(mrb_state *mrb, mt_state *t, mrb_value seed)
-{
+{
if (mrb_nil_p(seed)) {
seed = mrb_fixnum_value(time(NULL) + mt_rand(t));
if (mrb_fixnum(seed) < 0) {
@@ -55,9 +55,9 @@ mrb_random_mt_srand(mrb_state *mrb, mt_state *t, mrb_value seed)
return seed;
}
-static mrb_value
+static mrb_value
mrb_random_mt_rand(mrb_state *mrb, mt_state *t, mrb_value max)
-{
+{
mrb_value value;
if (mrb_fixnum(max) == 0) {
@@ -70,7 +70,7 @@ mrb_random_mt_rand(mrb_state *mrb, mt_state *t, mrb_value max)
return value;
}
-static mrb_value
+static mrb_value
get_opt(mrb_state* mrb)
{
mrb_value arg;
@@ -104,35 +104,35 @@ get_random_state(mrb_state *mrb)
return DATA_GET_PTR(mrb, random_val, &mt_state_type, mt_state);
}
-static mrb_value
+static mrb_value
mrb_random_g_rand(mrb_state *mrb, mrb_value self)
{
mrb_value random = get_random(mrb);
return mrb_random_rand(mrb, random);
}
-static mrb_value
+static mrb_value
mrb_random_g_srand(mrb_state *mrb, mrb_value self)
{
mrb_value random = get_random(mrb);
return mrb_random_srand(mrb, random);
}
-static mrb_value
+static mrb_value
mrb_random_init(mrb_state *mrb, mrb_value self)
{
mrb_value seed;
mt_state *t;
-
+
/* avoid memory leaks */
t = (mt_state*)DATA_PTR(self);
if (t) {
mrb_free(mrb, t);
- }
+ }
DATA_TYPE(self) = &mt_state_type;
DATA_PTR(self) = NULL;
-
+
t = (mt_state *)mrb_malloc(mrb, sizeof(mt_state));
t->mti = N + 1;
@@ -146,13 +146,13 @@ mrb_random_init(mrb_state *mrb, mrb_value self)
t->has_seed = TRUE;
t->seed = mrb_fixnum(seed);
}
-
+
DATA_PTR(self) = t;
-
+
return self;
}
-static void
+static void
mrb_random_rand_seed(mrb_state *mrb, mt_state *t)
{
if (!t->has_seed) {
@@ -160,7 +160,7 @@ mrb_random_rand_seed(mrb_state *mrb, mt_state *t)
}
}
-static mrb_value
+static mrb_value
mrb_random_rand(mrb_state *mrb, mrb_value self)
{
mrb_value max;
@@ -171,7 +171,7 @@ mrb_random_rand(mrb_state *mrb, mrb_value self)
return mrb_random_mt_rand(mrb, t, max);
}
-static mrb_value
+static mrb_value
mrb_random_srand(mrb_state *mrb, mrb_value self)
{
mrb_value seed;
@@ -205,7 +205,7 @@ mrb_ary_shuffle_bang(mrb_state *mrb, mrb_value ary)
{
mrb_int i;
mt_state *random = NULL;
-
+
if (RARRAY_LEN(ary) > 1) {
mrb_get_args(mrb, "|d", &random, &mt_state_type);
@@ -213,21 +213,21 @@ mrb_ary_shuffle_bang(mrb_state *mrb, mrb_value ary)
random = get_random_state(mrb);
}
mrb_random_rand_seed(mrb, random);
-
+
mrb_ary_modify(mrb, mrb_ary_ptr(ary));
-
+
for (i = RARRAY_LEN(ary) - 1; i > 0; i--) {
mrb_int j;
mrb_value tmp;
-
+
j = mrb_fixnum(mrb_random_mt_rand(mrb, random, mrb_fixnum_value(RARRAY_LEN(ary))));
-
+
tmp = RARRAY_PTR(ary)[i];
RARRAY_PTR(ary)[i] = RARRAY_PTR(ary)[j];
RARRAY_PTR(ary)[j] = tmp;
- }
+ }
}
-
+
return ary;
}
@@ -243,7 +243,7 @@ mrb_ary_shuffle(mrb_state *mrb, mrb_value ary)
{
mrb_value new_ary = mrb_ary_new_from_values(mrb, RARRAY_LEN(ary), RARRAY_PTR(ary));
mrb_ary_shuffle_bang(mrb, new_ary);
-
+
return new_ary;
}
@@ -272,7 +272,7 @@ mrb_ary_sample(mrb_state *mrb, mrb_value ary)
mrb_get_args(mrb, "|i?d", &n, &given, &random, &mt_state_type);
if (random == NULL) {
- random = get_random_state(mrb);
+ random = get_random_state(mrb);
}
mrb_random_rand_seed(mrb, random);
mt_rand(random);
@@ -334,7 +334,7 @@ void mrb_mruby_random_gem_init(mrb_state *mrb)
mrb_define_method(mrb, random, "initialize", mrb_random_init, MRB_ARGS_OPT(1));
mrb_define_method(mrb, random, "rand", mrb_random_rand, MRB_ARGS_OPT(1));
mrb_define_method(mrb, random, "srand", mrb_random_srand, MRB_ARGS_OPT(1));
-
+
mrb_define_method(mrb, array, "shuffle", mrb_ary_shuffle, MRB_ARGS_OPT(1));
mrb_define_method(mrb, array, "shuffle!", mrb_ary_shuffle_bang, MRB_ARGS_OPT(1));
mrb_define_method(mrb, array, "sample", mrb_ary_sample, MRB_ARGS_OPT(2));
diff --git a/mrbgems/mruby-random/test/random.rb b/mrbgems/mruby-random/test/random.rb
index fa31b782b..1653ae4a6 100644
--- a/mrbgems/mruby-random/test/random.rb
+++ b/mrbgems/mruby-random/test/random.rb
@@ -31,32 +31,32 @@ assert("float") do
rand.class == Float
end
-assert("Array#shuffle") do
+assert("Array#shuffle") do
ary = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
shuffled = ary.shuffle
-
+
ary == [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] and shuffled != ary and 10.times { |x| ary.include? x }
end
assert('Array#shuffle!') do
ary = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
ary.shuffle!
-
+
ary != [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] and 10.times { |x| ary.include? x }
end
-assert("Array#shuffle(random)") do
+assert("Array#shuffle(random)") do
assert_raise(TypeError) do
# this will cause an exception due to the wrong argument
[1, 2].shuffle "Not a Random instance"
end
-
+
# verify that the same seed causes the same results
ary1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
shuffle1 = ary1.shuffle Random.new 345
ary2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
shuffle2 = ary2.shuffle Random.new 345
-
+
ary1 != shuffle1 and 10.times { |x| shuffle1.include? x } and shuffle1 == shuffle2
end
@@ -65,12 +65,12 @@ assert('Array#shuffle!(random)') do
# this will cause an exception due to the wrong argument
[1, 2].shuffle! "Not a Random instance"
end
-
+
# verify that the same seed causes the same results
ary1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
ary1.shuffle! Random.new 345
ary2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
ary2.shuffle! Random.new 345
-
+
ary1 != [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] and 10.times { |x| ary1.include? x } and ary1 == ary2
end
diff --git a/mrbgems/mruby-string-ext/test/string.rb b/mrbgems/mruby-string-ext/test/string.rb
index 4c5620575..01712a607 100644
--- a/mrbgems/mruby-string-ext/test/string.rb
+++ b/mrbgems/mruby-string-ext/test/string.rb
@@ -31,7 +31,7 @@ assert('String#strip') do
end
assert('String#lstrip') do
- s = " abc "
+ s = " abc "
s.lstrip
"".lstrip == "" and " \t\r\n\f\v".lstrip == "" and
"\0a\0".lstrip == "\0a\0" and
@@ -43,7 +43,7 @@ assert('String#lstrip') do
end
assert('String#rstrip') do
- s = " abc "
+ s = " abc "
s.rstrip
"".rstrip == "" and " \t\r\n\f\v".rstrip == "" and
"\0a\0".rstrip == "\0a" and
@@ -122,7 +122,7 @@ end
assert('String#partition') do
assert_equal ["a", "x", "axa"], "axaxa".partition("x")
assert_equal ["aaaaa", "", ""], "aaaaa".partition("x")
- assert_equal ["", "", "aaaaa"], "aaaaa".partition("")
+ assert_equal ["", "", "aaaaa"], "aaaaa".partition("")
assert_equal ["", "a", "aaaa"], "aaaaa".partition("a")
assert_equal ["aaaa", "b", ""], "aaaab".partition("b")
assert_equal ["", "b", "aaaa"], "baaaa".partition("b")
@@ -132,7 +132,7 @@ end
assert('String#rpartition') do
assert_equal ["axa", "x", "a"], "axaxa".rpartition("x")
assert_equal ["", "", "aaaaa"], "aaaaa".rpartition("x")
- assert_equal ["aaaaa", "", ""], "aaaaa".rpartition("")
+ assert_equal ["aaaaa", "", ""], "aaaaa".rpartition("")
assert_equal ["aaaa", "a", ""], "aaaaa".rpartition("a")
assert_equal ["aaaa", "b", ""], "aaaab".rpartition("b")
assert_equal ["", "b", "aaaa"], "baaaa".rpartition("b")
diff --git a/mrbgems/mruby-string-utf8/test/string.rb b/mrbgems/mruby-string-utf8/test/string.rb
index ce99fba47..1bfa8512c 100644
--- a/mrbgems/mruby-string-utf8/test/string.rb
+++ b/mrbgems/mruby-string-utf8/test/string.rb
@@ -14,7 +14,7 @@ end
assert('String#reverse', '15.2.10.5.29') do
a = 'こんにちは世界!'
a.reverse
-
+
assert_equal 'こんにちは世界!', a
assert_equal '!界世はちにんこ', 'こんにちは世界!'.reverse
end
@@ -22,7 +22,7 @@ end
assert('String#reverse!', '15.2.10.5.30') do
a = 'こんにちは世界!'
a.reverse!
-
+
assert_equal '!界世はちにんこ', a
assert_equal '!界世はちにんこ', 'こんにちは世界!'.reverse!
end
diff --git a/mrbgems/mruby-toplevel-ext/test/toplevel.rb b/mrbgems/mruby-toplevel-ext/test/toplevel.rb
index 9630fe3dd..aebdd8b4b 100644
--- a/mrbgems/mruby-toplevel-ext/test/toplevel.rb
+++ b/mrbgems/mruby-toplevel-ext/test/toplevel.rb
@@ -15,7 +15,7 @@ assert('Toplevel#include') do
end
self.include ToplevelTestModule2, ToplevelTestModule1
-
+
assert_true self.class.included_modules.include?( ToplevelTestModule1 )
assert_true self.class.included_modules.include?( ToplevelTestModule2 )
assert_equal :foo, method_foo