Skip to content

Commit 18bf884

Browse files
author
Olivier Saut
committed
Use assert_eq! rather than assert! where possible
1 parent 99c7750 commit 18bf884

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/libstd/arc.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ mod tests {
501501
let arc_v = p.recv();
502502

503503
let v = copy *arc::get::<~[int]>(&arc_v);
504-
assert!(v[3] == 4);
504+
assert_eq!(v[3],4);
505505
};
506506

507507
let c = p.recv();
@@ -545,7 +545,7 @@ mod tests {
545545
do arc2.access_cond |one, cond| {
546546
cond.signal();
547547
// Parent should fail when it wakes up.
548-
assert!(*one == 0);
548+
assert_eq!(*one, 0);
549549
}
550550
}
551551

@@ -562,11 +562,11 @@ mod tests {
562562
let arc2 = ~arc.clone();
563563
do task::try || {
564564
do arc2.access |one| {
565-
assert!(*one == 2);
565+
assert_eq!(*one, 2);
566566
}
567567
};
568568
do arc.access |one| {
569-
assert!(*one == 1);
569+
assert_eq!(*one, 1);
570570
}
571571
}
572572
#[test] #[should_fail] #[ignore(cfg(windows))]
@@ -575,11 +575,11 @@ mod tests {
575575
let arc2 = (*arc).clone();
576576
do task::try || {
577577
do arc2.write |one| {
578-
assert!(*one == 2);
578+
assert_eq!(*one, 2);
579579
}
580580
};
581581
do arc.read |one| {
582-
assert!(*one == 1);
582+
assert_eq!(*one, 1);
583583
}
584584
}
585585
#[test] #[should_fail] #[ignore(cfg(windows))]
@@ -588,11 +588,11 @@ mod tests {
588588
let arc2 = (*arc).clone();
589589
do task::try || {
590590
do arc2.write |one| {
591-
assert!(*one == 2);
591+
assert_eq!(*one, 2);
592592
}
593593
};
594594
do arc.write |one| {
595-
assert!(*one == 1);
595+
assert_eq!(*one, 1);
596596
}
597597
}
598598
#[test] #[should_fail] #[ignore(cfg(windows))]
@@ -602,12 +602,12 @@ mod tests {
602602
do task::try || {
603603
do arc2.write_downgrade |mut write_mode| {
604604
do write_mode.write |one| {
605-
assert!(*one == 2);
605+
assert_eq!(*one, 2);
606606
}
607607
}
608608
};
609609
do arc.write |one| {
610-
assert!(*one == 1);
610+
assert_eq!(*one, 1);
611611
}
612612
}
613613
#[test] #[ignore(cfg(windows))]
@@ -616,11 +616,11 @@ mod tests {
616616
let arc2 = (*arc).clone();
617617
do task::try || {
618618
do arc2.read |one| {
619-
assert!(*one == 2);
619+
assert_eq!(*one, 2);
620620
}
621621
};
622622
do arc.read |one| {
623-
assert!(*one == 1);
623+
assert_eq!(*one, 1);
624624
}
625625
}
626626
#[test] #[ignore(cfg(windows))]
@@ -629,11 +629,11 @@ mod tests {
629629
let arc2 = (*arc).clone();
630630
do task::try || {
631631
do arc2.read |one| {
632-
assert!(*one == 2);
632+
assert_eq!(*one, 2);
633633
}
634634
};
635635
do arc.write |one| {
636-
assert!(*one == 1);
636+
assert_eq!(*one, 1);
637637
}
638638
}
639639
#[test] #[ignore(cfg(windows))]
@@ -644,12 +644,12 @@ mod tests {
644644
do arc2.write_downgrade |write_mode| {
645645
let read_mode = arc2.downgrade(write_mode);
646646
do (&read_mode).read |one| {
647-
assert!(*one == 2);
647+
assert_eq!(*one, 2);
648648
}
649649
}
650650
};
651651
do arc.write |one| {
652-
assert!(*one == 1);
652+
assert_eq!(*one, 1);
653653
}
654654
}
655655
#[test]
@@ -691,7 +691,7 @@ mod tests {
691691
// Wait for writer to finish
692692
p.recv();
693693
do arc.read |num| {
694-
assert!(*num == 10);
694+
assert_eq!(*num, 10);
695695
}
696696
}
697697
#[test]
@@ -713,7 +713,7 @@ mod tests {
713713
do task::spawn || {
714714
rp1.recv(); // wait for downgrader to give go-ahead
715715
do arcn.read |state| {
716-
assert!(*state == 31337);
716+
assert_eq!(*state, 31337);
717717
rc2.send(());
718718
}
719719
}
@@ -725,15 +725,15 @@ mod tests {
725725
do task::spawn || {
726726
wp1.recv();
727727
do arc2.write_cond |state, cond| {
728-
assert!(*state == 0);
728+
assert_eq!(*state, 0);
729729
*state = 42;
730730
cond.signal();
731731
}
732732
wp1.recv();
733733
do arc2.write |state| {
734734
// This shouldn't happen until after the downgrade read
735735
// section, and all other readers, finish.
736-
assert!(*state == 31337);
736+
assert_eq!(*state, 31337);
737737
*state = 42;
738738
}
739739
wc2.send(());
@@ -746,7 +746,7 @@ mod tests {
746746
while *state == 0 {
747747
cond.wait();
748748
}
749-
assert!(*state == 42);
749+
assert_eq!(*state, 42);
750750
*state = 31337;
751751
// send to other readers
752752
for reader_convos.each |x| {
@@ -764,7 +764,7 @@ mod tests {
764764
}
765765
}
766766
wc1.send(()); // tell writer to try again
767-
assert!(*state == 31337);
767+
assert_eq!(*state, 31337);
768768
}
769769
}
770770

0 commit comments

Comments
 (0)