Skip to content

Commit

Permalink
check line width not needed (paritytech#9820)
Browse files Browse the repository at this point in the history
* check line width not needed

(cargo fmt checks this)

* Fixing test to work in release mode.
  • Loading branch information
gilescope authored Sep 21, 2021
1 parent 0997854 commit 3486a13
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 67 deletions.
10 changes: 0 additions & 10 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,6 @@ check-signed-tag:
script:
- ./.maintain/gitlab/check_signed.sh

check-line-width:
stage: check
image: paritytech/tools:latest
<<: *kubernetes-env
rules:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
script:
- ./.maintain/gitlab/check_line_width.sh
allow_failure: true

test-dependency-rules:
stage: check
image: paritytech/tools:latest
Expand Down
55 changes: 0 additions & 55 deletions .maintain/gitlab/check_line_width.sh

This file was deleted.

9 changes: 7 additions & 2 deletions frame/bags-list/src/list/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,10 @@ mod bags {

// Panics in case of duplicate tail insert (which would result in an infinite loop).
#[test]
#[should_panic = "system logic error: inserting a node who has the id of tail"]
#[cfg_attr(
debug_assertions,
should_panic = "system logic error: inserting a node who has the id of tail"
)]
fn insert_node_duplicate_tail_panics_with_debug_assert() {
ExtBuilder::default().build_and_execute(|| {
let node = |id, prev, next, bag_upper| Node::<Runtime> { id, prev, next, bag_upper };
Expand All @@ -548,7 +551,9 @@ mod bags {

// when inserting a duplicate id that is already the tail
assert_eq!(bag_1000.tail, Some(4));
bag_1000.insert_node_unchecked(node(4, None, None, bag_1000.bag_upper)); // panics
assert_eq!(bag_1000.iter().count(), 3);
bag_1000.insert_node_unchecked(node(4, None, None, bag_1000.bag_upper)); // panics in debug
assert_eq!(bag_1000.iter().count(), 3); // in release we expect it to silently ignore the request.
});
}

Expand Down

0 comments on commit 3486a13

Please sign in to comment.