Lines Matching refs:aa

51     T[int] aa;  in testKeysValues1()
53 aa[0] = t; in testKeysValues1()
54 aa[1] = t; in testKeysValues1()
56 auto vals = aa.values; in testKeysValues1()
73 int[string] aa; in testKeysValues2()
75 assert(aa.keys.length == 0); in testKeysValues2()
76 assert(aa.values.length == 0); in testKeysValues2()
78 aa["hello"] = 3; in testKeysValues2()
79 assert(aa["hello"] == 3); in testKeysValues2()
80 aa["hello"]++; in testKeysValues2()
81 assert(aa["hello"] == 4); in testKeysValues2()
83 assert(aa.length == 1); in testKeysValues2()
85 string[] keys = aa.keys; in testKeysValues2()
89 int[] values = aa.values; in testKeysValues2()
93 aa.rehash; in testKeysValues2()
94 assert(aa.length == 1); in testKeysValues2()
95 assert(aa["hello"] == 4); in testKeysValues2()
97 aa["foo"] = 1; in testKeysValues2()
98 aa["bar"] = 2; in testKeysValues2()
99 aa["batz"] = 3; in testKeysValues2()
101 assert(aa.keys.length == 4); in testKeysValues2()
102 assert(aa.values.length == 4); in testKeysValues2()
104 foreach (a; aa.keys) in testKeysValues2()
110 foreach (v; aa.values) in testKeysValues2()
118 int[string] aa; in testGet1()
120 foreach (val; aa.byKeyValue) in testGet1()
122 ++aa[val.key]; in testGet1()
135 T[string] aa; in testGet2()
138 aa["foo"] = a; in testGet2()
140 auto b = aa.get("foo", new T); in testGet2()
143 auto c = aa.get("bar", new T); in testGet2()
148 assert("bar" !in aa); in testGet2()
159 T[string] aa; in testRequire1()
162 aa["foo"] = a; in testRequire1()
164 auto b = aa.require("foo", new T); in testRequire1()
167 auto c = aa.require("bar", null); in testRequire1()
170 assert("bar" in aa); in testRequire1()
171 auto d = aa.require("bar", new T); in testRequire1()
173 auto e = aa.require("baz", new T); in testRequire1()
177 assert("baz" in aa); in testRequire1()
180 auto f = aa.require("qux", { created = true; return new T; }()); in testRequire1()
184 auto h = aa.require("qux", { g = new T; return g; }()); in testRequire1()
195 S[string] aa; in testRequire2()
197 aa.require("foo").value = 1; in testRequire2()
198 assert(aa == ["foo" : S(1)]); in testRequire2()
200 aa["bar"] = S(2); in testRequire2()
201 auto a = aa.require("bar", S(3)); in testRequire2()
204 auto b = aa["bar"]; in testRequire2()
207 S* c = &aa.require("baz", S(4)); in testRequire2()
208 assert(c is &aa["baz"]); in testRequire2()
211 assert("baz" in aa); in testRequire2()
213 auto d = aa["baz"]; in testRequire2()
219 string[string] aa; in testRequire3()
221 auto a = aa.require("foo", "bar"); in testRequire3()
222 assert("foo" in aa); in testRequire3()
229 C[string] aa; in testUpdate1()
232 aa["foo"] = orig; in testUpdate1()
239 aa.update(key, { in testUpdate1()
251 assert(newer is aa["foo"]); in testUpdate1()
254 assert(newer is aa["bar"]); in testUpdate1()
260 C[string] aa; in testUpdate2()
283 aa.update("foo", new Creator, new Updater); in testUpdate2()
285 aa.update("foo", new Creator, new Updater); in testUpdate2()
300 BadValue[int] aa; in testByKey1()
301 () @safe { auto x = aa.byKey.front; } (); in testByKey1()
343 int[string] aa; in testByKey4()
345 aa[key] = 0; in testByKey4()
347 auto keyRange = aa.byKey(); in testByKey4()
354 aa[keyRange.front]++; in testByKey4()
361 assert(aa[key] == 1); in testByKey4()
369 aa[savedKeyRange.front]++; in testByKey4()
376 assert(aa[key] == 2); in testByKey4()
383 size_t[string] aa; in testByKey4()
386 aa[keys[i]] = i; in testByKey4()
389 auto valRange = aa.byValue(); in testByKey4()
431 int[int] aa; in issue5842Expanded()
433 aa[i] = i; in issue5842Expanded()
435 aa.remove(i); in issue5842Expanded()
436 aa.rehash; in issue5842Expanded()
437 aa[1] = 1; in issue5842Expanded()
466 Json[string] aa; in issue9052()
468 size_t length() const { return aa.length; } in issue9052()
478 int[string] aa;
479 assert(aa.byKeyValue.empty);
481 aa["a"] = 1;
482 aa["b"] = 2;
483 aa["c"] = 3;
485 auto pairs = aa.byKeyValue;
491 assert(pairs.front.key in aa);
492 assert(pairs.front.value == aa[pairs.front.key]);
496 assert(count == aa.length);
502 assert(savedPairs.front.key in aa);
503 assert(savedPairs.front.value == aa[savedPairs.front.key]);
507 assert(count == aa.length);
549 NC[string] aa;
550 static assert(!is(aa.nonExistingField));
556 auto aa = ["a": 1];
574 testFwdRange(aa.byKey, "a");
575 testFwdRange(aa.byValue, 1);
590 size_t[K] aa;
592 aa[key] = 12;
593 assert(key in aa);
600 string[string] aa;
601 inout(string) key() inout { return aa.byKey().front; }
602 inout(string) val() inout { return aa.byValue().front; }
603 auto keyval() inout { return aa.byKeyValue().front; }
614 inout(string)[typeof(key)] aa;
616 foreach (i; aa.byKey()) {}
617 foreach (i; aa.byValue()) {}
618 foreach (i; aa.byKeyValue()) {}
629 string[int] aa = [ 0: "a", 0: "b" ];
630 assert(aa.length == 1);
631 assert(aa.keys == [ 0 ]);
640 int[void delegate()] aa;
641 assert(aa.length == 0);
642 aa[&f1] = 1;
643 assert(aa.length == 1);
644 aa[&f1] = 1;
645 assert(aa.length == 1);
680 int[int] aa;
686 alias aa this;
696 auto aa = [1:2, 3:4];
697 foreach (const t; aa.byKeyValue)
715 int[S[]] aa = [[S(11)] : 13];
716 assert(aa[[S(12)]] == 13);
749 int[int] aa;
750 foreach (k, v; aa)
752 foreach (v; aa)
754 assert(aa.byKey.empty);
755 assert(aa.byValue.empty);
756 assert(aa.byKeyValue.empty);
759 aa = [0 : 3, 1 : 4, 2 : 5];
760 foreach (k, v; aa)
769 foreach (v; aa)
777 foreach (k, v; aa)
785 foreach (v; aa)
795 int[int] aa;
796 assert(!aa.remove(0));
797 aa = [0 : 1];
798 assert(aa.remove(0));
799 assert(!aa.remove(0));
800 aa[1] = 2;
801 assert(!aa.remove(0));
802 assert(aa.remove(1));
804 assert(aa.length == 0);
805 assert(aa.byKey.empty);
812 auto aa = [0 : V.init];
813 assert(aa.length == 1);
814 assert(aa.byKey.front == 0);
815 assert(aa.byValue.front == V.init);
816 aa[1] = V.init;
817 assert(aa.length == 2);
818 aa[0] = V.init;
819 assert(aa.length == 2);
820 assert(aa.remove(0));
821 aa[0] = V.init;
822 assert(aa.length == 2);
823 assert(aa == [0 : V.init, 1 : V.init]);
828 int[int] aa;
830 aa[i] = i;
832 assert(aa.remove(i));
834 aa[i] = i;
835 assert(aa.length == 4);
837 assert(i in aa);
842 int[int] aa;
843 assert(aa.length == 0);
845 aa[i] = i * 2;
846 assert(aa.length == 100);
847 auto aa2 = aa;
849 aa.clear();
850 assert(aa.length == 0);
854 assert(aa.length == 1);
855 assert(aa[5] == 6);