@@ -99,12 +99,12 @@ fn test_reader() {
9999 let mut conn = Conn :: connect ( & mut c) . expect ( "Couldn't open DB." ) ;
100100 {
101101 let db_tx = c. transaction ( ) . expect ( "db tx" ) ;
102- // Ensure that the first ( bootstrap) transaction is skipped over .
102+ // Ensure that we see a bootstrap transaction.
103103 let mut receiver = TxCountingReceiver :: new ( ) ;
104104 assert_eq ! ( false , receiver. is_done) ;
105105 Processor :: process ( & db_tx, None , & mut receiver) . expect ( "processor" ) ;
106106 assert_eq ! ( true , receiver. is_done) ;
107- assert_eq ! ( 0 , receiver. tx_count) ;
107+ assert_eq ! ( 1 , receiver. tx_count) ;
108108 }
109109
110110 let ids = conn. transact ( & mut c, r#"[
@@ -114,6 +114,11 @@ fn test_reader() {
114114 ]"# ) . expect ( "successful transaction" ) . tempids ;
115115 let numba_entity_id = ids. get ( "s" ) . unwrap ( ) ;
116116
117+ let ids = conn. transact ( & mut c, r#"[
118+ [:db/add "b" :foo/numba 123]
119+ ]"# ) . expect ( "successful transaction" ) . tempids ;
120+ let _asserted_e = ids. get ( "b" ) . unwrap ( ) ;
121+
117122 let first_tx;
118123 {
119124 let db_tx = c. transaction ( ) . expect ( "db tx" ) ;
@@ -123,10 +128,11 @@ fn test_reader() {
123128
124129 println ! ( "{:#?}" , receiver) ;
125130
126- assert_eq ! ( 1 , receiver. txes. keys( ) . count( ) ) ;
127- assert_tx_datoms_count ( & receiver, 0 , 4 ) ;
131+ // Three transactions: bootstrap, vocab, assertion.
132+ assert_eq ! ( 3 , receiver. txes. keys( ) . count( ) ) ;
133+ assert_tx_datoms_count ( & receiver, 2 , 2 ) ;
128134
129- first_tx = Some ( * receiver. txes . keys ( ) . nth ( 0 ) . expect ( "first tx" ) ) ;
135+ first_tx = Some ( * receiver. txes . keys ( ) . nth ( 1 ) . expect ( "first non-bootstrap tx" ) ) ;
130136 }
131137
132138 let ids = conn. transact ( & mut c, r#"[
@@ -143,11 +149,13 @@ fn test_reader() {
143149 // Note that we're asking for the first transacted tx to be skipped by the processor.
144150 Processor :: process ( & db_tx, first_tx, & mut receiver) . expect ( "processor" ) ;
145151
146- assert_eq ! ( 1 , receiver. txes. keys( ) . count( ) ) ;
147- assert_tx_datoms_count ( & receiver, 0 , 2 ) ;
152+ // Vocab, assertion.
153+ assert_eq ! ( 2 , receiver. txes. keys( ) . count( ) ) ;
154+ // Assertion datoms.
155+ assert_tx_datoms_count ( & receiver, 1 , 2 ) ;
148156
149- // Inspect the transaction part .
150- let tx_id = receiver. txes . keys ( ) . nth ( 0 ) . expect ( "tx" ) ;
157+ // Inspect the assertion .
158+ let tx_id = receiver. txes . keys ( ) . nth ( 1 ) . expect ( "tx" ) ;
151159 let datoms = receiver. txes . get ( tx_id) . expect ( "datoms" ) ;
152160 let part = datoms. iter ( ) . find ( |& part| & part. e == asserted_e) . expect ( "to find asserted datom" ) ;
153161
0 commit comments