/*
 *  issue-707.sli
 *
 *  This file is part of NEST.
 *
 *  Copyright (C) 2004 The NEST Initiative
 *
 *  NEST is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  NEST is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with NEST.  If not, see <http://www.gnu.org/licenses/>.
 *
 */


 /* BeginDocumentation
Name: testsuite::issue-707

Synopsis: (issue-707) run -> NEST exits if test fails

Description:
This test ensures that the weight of gap junctions can
be recorded with the weight_recorder (thus that SecondaryEvents
have a properly set time stamp).

Author: Jan Hahne
FirstVersion: April 2017
SeeAlso:
*/

(unittest) run
/unittest using

% The following test needs the model hh_psc_alpha_gap, so
% this test should only run if we have GSL
skip_if_without_gsl

{
  ResetKernel

  /hh_psc_alpha_gap Create /neuron_in Set
  /hh_psc_alpha_gap Create /neuron_out Set
  /weight_recorder Create /wr Set

  /gap_junction << /weight_recorder wr >> SetDefaults

  [neuron_in] [neuron_out]
  << /rule /one_to_one /make_symmetric true >>
  << /model /gap_junction /weight 2.0 >>
  Connect

  10 Simulate

  wr GetStatus /events get /weights get 1 get

  2.0 eq
}
assert_or_die

endusing
