()
| 114 | |
| 115 | #[test] |
| 116 | fn test_balance_javascript() { |
| 117 | let code = r#" |
| 118 | // called by the server or (most often) in case of any action on a message |
| 119 | // (so this is very frequently called on non pings) |
| 120 | notif.removePing = function(mid, forwardToServer, flash){ |
| 121 | if (!mid) return; |
| 122 | // we assume here there's at most one notification to a given message |
| 123 | for (var i=0; i<notifications.length; i++) { |
| 124 | if (notifications[i].mid==mid) { |
| 125 | if (flash) { |
| 126 | var $md = $('#messages .message[mid='+mid+']'); |
| 127 | if ($md.length) { |
| 128 | md.goToMessageDiv($md); |
| 129 | } |
| 130 | } |
| 131 | if (forwardToServer) ws.emit("rm_ping", mid); |
| 132 | notifications.splice(i, 1); |
| 133 | notif.updatePingsList(); |
| 134 | return; |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | "#; |
| 139 | let list = LocList::read_str(code, Language::Javascript).unwrap(); |
| 140 | assert!(list.is_complete()); |
| 141 | } |
nothing calls this directly
no outgoing calls
no test coverage detected